Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Ruby Programming Language

Net/FTP: failed download creates empty file


I'm downloading a file via FTP like this:

require 'net/ftp'
ftp=Net::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
exist (i.e. the exception is thrown - "download fluffi failed (550 Can't
open
fluffi: No such file or directory)"), there is still a file 'fluffi'
created
with length 0.

Is this a bug or intended behaviour?

Ronald
--
Ronald Fischer <ronald.fisc@venyon.com>
Phone: +49-89-452133-162

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc