Hello,
I am a Ruby N.
I need to login to a ftp server and download the newest file on the
server. I know the basics of Net::FTP but I can’t figure out how to
download the newest file based on its time stamp.
Any Ideas
Thanks
Hello,
I am a Ruby N.
I need to login to a ftp server and download the newest file on the
server. I know the basics of Net::FTP but I can’t figure out how to
download the newest file based on its time stamp.
Any Ideas
Thanks
On Dec 6, 2007 6:29 AM, Brian S. [email protected] wrote:
Hello,
I am a Ruby N.
I need to login to a ftp server and download the newest file on the
server. I know the basics of Net::FTP but I can’t figure out how to
download the newest file based on its time stamp.
FTP#list gives you list of files, possibly with timestamps, and
FTP#mtime gives you last modification time of a particular file.
RTFRDoc (e.g. RDoc Documentation)
On Dec 6, 2007 5:27 AM, Jano S. [email protected] wrote:
FTP#mtime gives you last modification time of a particular file.
RTFRDoc (e.g. RDoc Documentation)
Thanks for the link to the docs. Here’s the one for NET::FTP:
http://ruby-doc.org/core/classes/Net/FTP.html
Unfortunately, I can’t get the example to work for me. Specifically,
this worked:
$ ruby -le ‘require “net/ftp” ; print “hello”’
but this does not, i.e. it just sits there:
$ ruby -le ‘require “net/ftp” ; ftp = Net::FTP.new(“ftp.netlab.co.jp”)
; print “hello”’
So I changed to an ftp server that I know works, i.e. I can connect to
it via firefox:
$ ruby -le ‘require “net/ftp” ; ftp =
Net::FTP.new(“ftp.ncbi.nlm.nih.gov”) ; print “hello”’
Still no dice. It’s possible that this is because I’m behind a
firewall? ftp_proxy is set
to something like “http://proxy.foobar.com:12345” and I’ve issued an
‘export SOCKS_SERVER=$ftp_proxy’, but ruby still doesn’t work for me.
FYI:
$ ( set -x ; ruby -v ; cat /etc/issue.net )
Any pointers in the right direction appreciated.
Regards,
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs