From: Henrik Horneber Date: 2004-10-09T02:10:00+09:00 Subject: Re: open-uri and ftp problem Tanaka Akira wrote: > > I think Net::FTP#getbinaryfile should accept nil as the localfile > argument. > > If so, open-uri can avoid /dev/null. Hi! Thanks for your reply! Unfortunately, Net::FTP#getbinaryfile does not accept nil, as far as I understand the source, it passes the parameter to open, and dies with H:/ruby/ruby_install/ruby/lib/ruby/1.8/open-uri.rb:87:in `open_uri_original_open': cannot convert nil into String (TypeError) When I change ftp.getbinaryfile(self.path, '/dev/null', Net::FTP::DEFAULT_BLOCKSIZE) {|str| to ftp.getbinaryfile(self.path) {|str| in open-uri.rb, it only falls back to Net::FTP#getbinaryfile's default value, which simply is the basename of the remote file, so that I end up with the file on my hard drive. (This sounds strange if you don't know the context, but this gets called from open("ftp://") with a block, so I want to handle the data myself without temporary storage on disk) . I'm stuck. Would this not be a problem if I were using the cygwin build, because there might exist some fake /dev/null? regards, Henrik