Net/FTP: failed download creates empty file

R

Ronald Fischer

I'm downloading a file via FTP like this:

require 'net/ftp'
ftp=3DNet::FTP.new(hostname,userid,password)
begin
ftp.getbinaryfile('fluffi')
rescue Net::FTPPermError
puts "download #{filename} failed (#{$!.to_s.chomp})"
end

This works basically fine, with one minor glitch: If the file ('fluffi')
does not=20
exist (i.e. the exception is thrown - "download fluffi failed (550 Can't
open=20
fluffi: No such file or directory)"), there is still a file 'fluffi'
created
with length 0.

Is this a bug or intended behaviour?

Ronald
--=20
Ronald Fischer <[email protected]>
Phone: +49-89-452133-162
=20
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top