curl-library
Re: libcurl FTP - directory listing by file mask
Date: Fri, 28 Mar 2008 10:37:44 -0500
On Fri, Mar 28, 2008 at 10:11 AM, Alla Bogolubov <abogolub_at_opentext.com> wrote:
> Dan, Built-in ftp clients on most platforms have mget functions
> implemented. You can issue a command 'mget *.txt' and you will receive
> all files that meet the mask. I doubt that *.txt is legal as a file name
> on UNIX. I was unable to create a file with this name on HP-UX or
> Solaris. Also, try 'ls *.txt' or 'vi *.txt' It will list all files with
> *.txt extension and open *.txt files one after another.
Just FYI:
-bash-3.00$ touch '*.txt'
-bash-3.00$ touch star.txt
-bash-3.00$ ls -l
total 0
-rw-r--r-- 1 myuser other 0 Mar 28 10:31 *.txt
-rw-r--r-- 1 myuser other 0 Mar 28 10:31 star.txt
-bash-3.00$ rm '*.txt'
-bash-3.00$ ls -l
total 0
-rw-r--r-- 1 myuser other 0 Mar 28 10:31 star.txt
The same works on both Solaris 10 and Gentoo Linux. Actually, so does this:
-bash-3.00$ touch '! @ # $ % ^ & * ( )'
-bash-3.00$ ls -l
total 0
-rw-r--r-- 1 myuser other 0 Mar 28 10:34 ! @ # $ % ^ & * ( )
I'm not saying it's *useful*, but it's not difficult either.
Ralph Mitchell
Received on 2008-03-28