[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Readdir Help



I haven't looked in detail, but always assumed it was in alphabetical
order, with . (self directory) and .. (parent directory) listed first.
The IBM documentation for opendir() and readdir() does not specify. That
or I'm getting older...

Do you want to see the files created (or modified) most recently?
Searching Google for __opendir sort__ brings a lot of PHP coding
examples, most of which read the output of opendir() into an array, then
sort it by the relevant criteria. You may need to use stat() in
conjunction to bring in additional information, never tried it myself.

--Loyd


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott and
Kelly
Sent: Wednesday, April 22, 2009 1:39 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Readdir Help

I am using FTP_Get to receive multiple files. Then I use OPENDIR and
READDIR to process the files. It seems that the READDIR starts reading
the last file written to the directory and then reads the previous file,
etc until all files are read. I would like to read the first file
written to the directory then the next one written, etc. Is this
possible? What criteria does the READDIR use when reading through the
files?

 

Thanks for any help.

 

Kelly


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------