468,272 Members | 2,025 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

How to Get The Files datewise using FindFirstFile Function

I am using the function FindFirstFile to pick files from a folder to process. But the files selecting is based on name ,I need to get the files selected based on datetime( means frst come firstout ). Is there any option with FindFirstFile or any other function is there that I can use with c++? please help me...
Sep 3 '08 #1
6 6029
newb16
687 512MB
Actually they aren't sorted at all, that can be checked in documentation. You must sort them by yourself - by name, date or whatever.
Sep 3 '08 #2
Laharl
849 Expert 512MB
I believe FindFirstFileEx allows for more selective searching, but I've never looked at its docs...Google is your friend.
Sep 3 '08 #3
Actually they aren't sorted at all, that can be checked in documentation. You must sort them by yourself - by name, date or whatever.
I can't able to seen any sorting options in FindFirstFile
Sep 4 '08 #4
I believe FindFirstFileEx allows for more selective searching, but I've never looked at its docs...Google is your friend.
Anybody is there to help me in this problem?
Sep 11 '08 #5
newb16
687 512MB
Anybody is there to help me in this problem?
You must sort them by yourself - by name, date or whatever.
Sep 11 '08 #6
piyaca
2
From MSDN: "The search is performed strictly on the name of the file, not on any attributes such as a date or a file type"

I suggest building a list of all files in the directory and then using GetFileAttributesEx on each file. This can populate a WIN32_FILE_ATTRIBUTE_DATA structure with everything needed to sort the files how you want (eg. date/time).
Sep 11 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Andrew Edwards | last post: by
9 posts views Thread by Comcast Newsgroups | last post: by
30 posts views Thread by Jrdman | last post: by
Airslash
2 posts views Thread by Airslash | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.