On Sat, 4 Aug 2007, Micah Cowan wrote:

Just a word of caution here: while RFC1738 tells this is the way to do it, there are servers and times where this approach doesn't work. (lib)curl has an option to specify the CWD style (multiple cwd, single cwd or no cwd) due to this...

Could you be more specific about how it fails to work on some systems? I understand (from comments in wget) that OS/400 doesn't support hierarchies: but then no legitimate OS/400 FTP URL would include more than one dir component in its path.

Sorry, but the exact details have escaped so I can't provide them right now. I'm sure someone will remind us later on if you change wget to multi-CWD ;-)

I remember one situation has been that the server doesn't allow you to CWD into the dir, but allows you to CWD into the dir's subdir! So that

"CWD dir1" fails, but

"CWD dir1/dir2" works

Given that probably most other user-agents follow the RFC in this regard

Why do think that? I remember back when we made curl do this (April 2003), a guy named David Balazic posted an RFC1738 compliance summary where he tested a range of FTP clients and as I recall it very few of them used the multi-CWD way. Of course time has since passed so the situation may have changed, but I believe many still use the single CWD or even no CWD approach.

Unfortunately that summary URL is now a 404...

I'm having a little problem seeing how an FTP server that can't handle this could survive, particularly since, from the beginning of time, it's been the only way to reliably specify the directory path one wants.

Reliably for multiple servers, no. But reliable for a specific server that you're using, sure.

Technically, we can violate the RFCs (specifically, RFC 1738, which defines the ftp URL scheme in terms of a string of CWDs from the starting directory), if the FTP server starts us out in a directory other than /

The particular login directory doesn't affect the CWD approach at all, since the URL gives the path relative to the login directory...

Do you mean that wget tacks the path onto the value it gets from PWD, then?

No I don't, I don't know how wget creates the dir it sends with CWD.

In the quote above you wrote that "we can violate" ... "*if* the FTP server starts us out in a directory other than /" (my emphasis), and I just mentioned that you can do the exact same work no matter what the login directory is.

Reply via email to