Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Retrive file list in reverse date order

58 views
Skip to first unread message

Jonathan Bishop

unread,
Aug 17, 2004, 1:25:13 PM8/17/04
to
I am using the Win32 API FindFirstFile and FindNextFile to retrive a list of
files in a folder.

Does anyone know how to retrieve this list in reverse Creation date order ?

Cheers

JB


Norm Dresner

unread,
Aug 17, 2004, 8:39:47 PM8/17/04
to
"Jonathan Bishop" <Jonatha...@BTInternet.com> wrote in message
news:cftf1p$5ej$1...@hercules.btinternet.com...

AFAIK you get the list in whatever order the kernel wants to give it to you.
AIUI it's really just the order in which they occur in the directory which
is creation order for files created in an empty directory but as files are
deleted their entry positions are reused.

Norm

Severian

unread,
Aug 18, 2004, 1:23:22 AM8/18/04
to

On NTFS filesystems, you'll get the files in alphabetical order; on
FAT filesystems, they'll be in no guaranteed order.

--
Sev

Sten Westerback

unread,
Aug 18, 2004, 11:18:09 AM8/18/04
to

"Jonathan Bishop" <Jonatha...@BTInternet.com> wrote in message
news:cftf1p$5ej$1...@hercules.btinternet.com...

As others pointed out you get the names in the most efficient order ...
for the kernel that is.. :)

There are however numerous ways to sort string. One way is to create
(or use a hidden one on a dialog box) an Listbox with the sort option.
In fact, you might find the LB_DIR message useful.

- Sten

Severian

unread,
Aug 18, 2004, 1:33:18 PM8/18/04
to

Also, if you're working in C (perhaps even C++, though STL gives you
many additional methods), retrieve your file info into an array of
WIN32_FIND_DATA structures, and use qsort() to sort them.

--
Sev

Jonathan Bishop

unread,
Aug 18, 2004, 2:52:48 PM8/18/04
to
OK !

Many thanks for your answers everyone.

Jon.

"Jonathan Bishop" <Jonatha...@BTInternet.com> wrote in message
news:cftf1p$5ej$1...@hercules.btinternet.com...

0 new messages