[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

open-uri and ftp path

Guillaume Marcais

2/18/2005 7:46:00 PM

I have an IIS server serving file with FTP. . When I log in with an ftp
client as 'weblog', IIS changes automatically to the weblog directory.
That's find and dandy as far as I am concerned, that's where the files
reside. But this confuses open-uri when I try to download a file:

$ irb
irb(main):001:0> require 'open-uri'
=> true
irb(main):002:0> fd = open("ftp://weblog:pass@address.com/ex050218.log")
Net::FTPPermError: 550 /ex050218.log: The system cannot find the file
specified.

from /usr/lib/ruby/1.8/net/ftp.rb:243:in `getresp'
from /usr/lib/ruby/1.8/net/ftp.rb:264:in `sendcmd'
from /usr/lib/ruby/1.8/net/ftp.rb:262:in `synchronize'
from /usr/lib/ruby/1.8/net/ftp.rb:262:in `sendcmd'
from /usr/lib/ruby/1.8/net/ftp.rb:336:in `transfercmd'
from /usr/lib/ruby/1.8/net/ftp.rb:401:in `retrbinary'
from /usr/lib/ruby/1.8/net/ftp.rb:399:in `synchronize'
from /usr/lib/ruby/1.8/net/ftp.rb:399:in `retrbinary'
from /usr/lib/ruby/1.8/net/ftp.rb:501:in `getbinaryfile'
from /usr/lib/ruby/1.8/open-uri.rb:600:in `direct_open'
from /usr/lib/ruby/1.8/open-uri.rb:169:in `open_loop'
from /usr/lib/ruby/1.8/open-uri.rb:164:in `catch'
from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
from /usr/lib/ruby/1.8/open-uri.rb:134:in `open_uri'
from /usr/lib/ruby/1.8/open-uri.rb:424:in `open'
from /usr/lib/ruby/1.8/open-uri.rb:85:in `open'
irb(main):003:0> fd =
open("ftp://weblog:pass@address.com/weblog/ex050218.log")
=> #<File:/home/gus/tmp/open-uri6592.0>
irb(main):004:0>
URI.parse("ftp://weblog:pass@address.com/ex050218.log").path
=> "/ex050218.log"

The problem is that the path reads '/ex050218.log' instead of just
'ex050218.log'.

Downloading this file using wget and the same URI works flawlessly.

Is it a bug on open-uri implementation? A difference between common
interpretation and actual definition of a URI?

Guillaume.



2 Answers

Tanaka Akira

2/19/2005 3:56:00 PM

0

In article <1108755950.1021.13.camel@comp.rapiddsl.net>,
Guillaume Marcais <guslist@free.fr> writes:

> Is it a bug on open-uri implementation? A difference between common
> interpretation and actual definition of a URI?

It's a bug. Thank you for the report.

It's fixed now.
--
Tanaka Akira


Guillaume Marcais

2/19/2005 9:01:00 PM

0

Thank you for your quick fix.

Guillaume.

Le 19 févr. 05, à 10:56, Tanaka Akira a écrit :

> In article <1108755950.1021.13.camel@comp.rapiddsl.net>,
> Guillaume Marcais <guslist@free.fr> writes:
>
>> Is it a bug on open-uri implementation? A difference between common
>> interpretation and actual definition of a URI?
>
> It's a bug. Thank you for the report.
>
> It's fixed now.
> --
> Tanaka Akira
>