cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: retrieving basic file information

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 17 Oct 2004 14:27:23 +0200 (CEST)

On Sat, 16 Oct 2004, Gary wrote:

> I was wondering if someone could point me to information on how to retrieve
> information for files stored in a directory on a remote server? Or a quick
> demo of how to do that? (if its possible)
> Basically the information I'm looking for:
> -a list of filenames in the directory

Use a slash last in the URL to get the LIST output or use CURLOPT_FTPLISTONLY
to make libcurl use NLST instead.

> -the create, last modified, and last accessed dates of the individual files

Listing the files get you a non standardized list output and you may be able
to figure out the modified date from that, otherwise you can use
CURLOPT_FILETIME when getting an individual file to get is modification date.

Create and last access times aren't available over FTP (and even the modified
date relies on non-RFC959 commands).

> -individual file sizes

It is the same. Get the listing and try to figure it out, or get the single
file and see for yourself. Set CURLOPT_NOBODY to not actually download the
file, only get the "headers".

> -files short/long file name

That sounds like a windows insanity I know as little as possible about.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-10-17