Sha256: c420325bb93facea2db6a84783f5e9aa64caf03ad42e7aeda081b0ed01075a11

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

def downloadrwdschedulefiles
 require 'net/ftp'
 BasicSocket.do_not_reverse_lookup = true 
 @rwdscheduleftpdisplays = ""
  begin
 ftp = Net::FTP::new($rwdschedule_ftpsite)
 @rwdscheduleftpdisplay  = "files downloaded" + "\n" 
 ftp.debug_mode = false
 ftp.login($rwdschedule_ftplogin, $rwdschedule_ftppassword)
 ftp.chdir($rwdschedule_ftpdirectory)
 print "I'm in the directory ", ftp.pwd(), "\n"
 schfiles = ftp.nlst($rwdschedule_ftpdirectory) 
 
   schfiles.each {|x|
      #adjust the filters to the files you want to see...

    if x =~ /sch/                               
        lastslash = x.rindex('/')+1
        newstring = x.slice(lastslash..256)
          
    localupdatefile = $rwdschedule_updatedirectory +"/"+ "#{newstring}"
    ftp.getbinaryfile("#{x}" , localupdatefile )         
    @rwdscheduleftpdisplay  =   @rwdscheduleftpdisplay + newstring + "\n"                               
                             
         end
                  
                             
                  }
   ftp.close
  
rescue
  @rwdscheduleftpdisplay = "ftp error"
if ftp
 ftp.close
 end
end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
bigtinker-0.95 code/superant.com.schedule/downloadrwdschedulefiles.rb
bigtinker-0.98 code/superant.com.schedule/downloadrwdschedulefiles.rb
rwdschedule-0.07 code/superant.com.schedule/downloadrwdschedulefiles.rb
rwdschedule-1.02 code/superant.com.schedule/downloadrwdschedulefiles.rb