From: Andrew Falanga Date: 2005-07-29T08:01:04+09:00 Subject: Re: Ruby libraries Ezra Zygmuntowicz wrote: > Andrew- > There is an ftp library in the ruby standard library. Here is a > little script that recursively descends through a directory and uploads > all the files to an ftp server: > > #!/usr/local/bin/ruby > # This script uploads a folder of images via ftp > > require 'find' > require 'net/ftp' > > path = "/Volumes/Users/ez/logos/" # <= set this to the path of your > folder of images > > ftp = Net::FTP.new('ftp.example.com') > ftp.login("username", "password") > files = ftp.chdir('logos') > > Find.find(path) do |file| > unless test(?d, file) #<= this tests to make sure its a file > and not a directory before continuing. > ftp.putbinaryfile("#{file}", "#{File.basename(file)}") #<= > this assumes binary files. > puts "Uploaded #{file}" > end > end > > ftp.close > > Hope that helps > -Ezra Outstanding! I forgot to ask in the original post, however, that I also need a library for creating CRC's with a divisor of 32bits. Does something like this exist? -- --------------------------------------------- Andrew R. Falanga (a non-HP employee) Hewlett-Packard Company 11311 Chinden Blvd. Boise, Idaho --------------------------------------------- Please note: The e-mail address is purposely mangled. I do not wish my account at HP to become a spam haven.