cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl FTP - directory listing by file mask

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 28 Mar 2008 16:39:24 +0100 (CET)

On Fri, 28 Mar 2008, Dan Fandrich wrote:

>> the -l option was used with a filename it would be logical to make this
>> similar to an 'ls' command, so file name could be treated as a regex?
>> This would be of particular use with the command, but would also make
>> life easier for library users. A regex would need additional libraries,
>> but simple '*' and '?' matching could be handled internally.
>
> curl doesn't need to do any regex parsing or globbing--it would simply send
> the "file name" string as an argument to the NLST command and let the remote
> server handle it in whichever way it desires. The inconsistency is that you
> can't do that for the LIST command as well due to the potential ambiguity.

Right, but I would also guess that ftp servers will treat those
wildcards/patterns differently since they aren't defined in any standard
either. Thus, you might end up more or less forced to do the pattern matching
locally just to be sure on how it is made given the list of files the server
claims is there.

However, this is just my guess.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-28