cURL / Mailing Lists / curl-library / Single Mail


Re: How to capture the STAT output in a variable ?

From: Michael Wood <>
Date: Wed, 17 Dec 2008 09:26:23 +0200

On Wed, Dec 17, 2008 at 8:22 AM, Dan Fandrich <> wrote:
> On Wed, Dec 17, 2008 at 05:10:01PM +1100, Sundar, Karthik wrote:
>> I CWD to a directory and use STAT *.* command to get the list of all the files
>> in the directory printed in the stdout .But is there any way I can store this
>> result in a variable.
> You should be able to get it through a header callback function. But why
> do it this way? Why not just let libcurl itself give you a directory
> listing? Just add a slash to the end of the URL or use CURLOPT_DIRLISTONLY.
> It's not a good idea to use CWD in a quote command, anyway, because it puts
> libcurl out of sync with the server w.r.t. CWD.

Also bear in mind that if this is a UNIX FTP server then *.* will not
match files that do not have a dot in their names.

Michael Wood <>
Received on 2008-12-17