Sha256: a895e417b58be0adeb7eb3831fe1a64791d5fdb05a3893c6297e0671443c5e07

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# down load address
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

1 entries across 1 versions & 1 rubygems

Version Path
rwdaddresses-1.02 code/superant.com.rwdaddresses/downloadrwdaddressfiles.rb