Sha256: 9647105390e2cf2c35214d1d06a7e47e9b2a613afce94f6cb9919b4c32b3c11f

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

def downloadrwdaddressfiles
 require 'net/ftp'
 BasicSocket.do_not_reverse_lookup = true 
 @rwdaddressesftpdisplays = ""
  begin
 ftp = Net::FTP::new($rwdaddresses_ftpsite)
 @rwdaddressesftpdisplay  = "files downloaded" + "\n" 
 ftp.debug_mode = false
 ftp.login($rwdaddresses_ftplogin, $rwdaddresses_ftppassword)
 ftp.chdir($rwdaddresses_ftpdirectory)
 print "I'm in the directory ", ftp.pwd(), "\n"
 schfiles = ftp.nlst($rwdaddresses_ftpdirectory) 
   schfiles.each do |x|
                          #adjust the filters to the files you want to see...
                             if(!test(?d,x))
                                   if x =~ /nam/
                                      lastslash = x.rindex('/')+1
                                      newstring = x.slice!(lastslash..256)
                                     localupdatefile = File.join($rwdaddresses_updatedirectory, "#{newstring}")
                                     ftp.getbinaryfile("#{newstring}" , localupdatefile )
                                 @rwdaddressesftpdisplay  =   @rwdaddressesftpdisplay + newstring + "\n"                               
                             end
                             end
                             
                         end
   ftp.close
  
 rescue
   if ftp
     ftp.close
   end
 @rwdaddressesftpdisplay = "ftp error"
 end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rwdaddresses-1.01 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb
rwdaddresses-0.99 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb
rwdaddresses-0.95 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb
rwdaddresses-0.98 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb
rwdaddresses-0.97 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb
rwdaddresses-0.94 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb