open-uri behaviour change

S

Scott Cook

I noticed a change in behaviour for open-uri when using it for automatic
ftp

It works fine in Ruby 1.8.1 as follows:......
[foo@bar ~]$ ruby -v
ruby 1.8.1 (2003-12-25) [x86_64-linux-gnu]
[foo@bar ~]$ ruby -le 'require "open-uri"; gg =
open("ftp://user:password@server:/tmp/ftptest/file1.txt;type=i")'
[foo@bar ~]$

But it's broken in 1.8.6:............
[foo@bar ~]$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux]
[foo@bar ~]$ ruby -le 'require "open-uri"; gg =
open("ftp://user:password@server:/tmp/ftptest/file1.txt;type=i")'
/usr/local/lib/ruby/1.8/net/ftp.rb:243:in `getresp': 550 tmp: No such
file or directory. (Net::FTPPermError)
from /usr/local/lib/ruby/1.8/net/ftp.rb:251:in `voidresp'
... blah blah blah ....
from -e:1
[foo@bar ~]$

After messing with it for a while, I found that the problem is that
open-uri now searches for "tmp" starting from the home directory of the
user that it logs in as (instead of from root, which would be logical
since the filename starts with "/")

a "workaround" is:
[foo@bar ~]$ ruby -le 'require "open-uri"; gg =
open("ftp://user:password@server:/../../../tmp/ftptest/file1.txt;type=i")'

which forces it to go to root and then find "tmp"


Where do I post this so that someone can do something about it?
Thanks!
Scott
 

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

Similar Threads

open-uri and ftp path 2
open-uri and ftp problem 4
open-uri and utf8 1
Anybody tell me about net/ftp protocol ? 2
Problem with open-uri 4
tcp socket error 0
I'm stuck with 'open-uri' 0
open-uri question 1

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top