473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 6415
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

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

Similar topics

12
by: deko | last post by:
Is there a quick and dirty way to delete all files in a given directory? perhaps something like this: Set objFile = CreateObject("Scripting.FileSystemObject") objFile.DeleteFile "all files in...
6
by: Andrew Edwards | last post by:
I have program that downloads a file from the internet and extracts it using calls to system(). All files are extracted into the directory where my program is located. How do I redirect the...
2
by: LewS | last post by:
My application uses FindFirstFile for searching for specific file types entered by a user. Entries like c:\myfiles\*.txt and \\myserver\shareddrive\myfiles\*.txt work okay, but when I use a UNC...
1
by: Rups | last post by:
API FindFirstFile searches for files based on long and short names(8+3). If i need to search files based on long names only . How can i do ?Is there any other API which does search based on long...
3
by: ManningFan | last post by:
Due to the way our IT group has set up our servers, we are not allowed to use the Shell() command. We are already doing a similar action with an FTP command. Our code is thus: sExe =...
9
by: Comcast Newsgroups | last post by:
Hello everyone, I am programming in Visual Studio 2002, VB.net. I typically stick to version 1.0 of the framework for compatibility reasons. Recently, I ran into an issue that I couldn't...
3
by: gudiya | last post by:
hi, My code works but i am missing the first 2 characters of file name. Any idea why???? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;...
30
by: Jrdman | last post by:
hi there can any one write a C code that search for files in a directory without using the windows apis(FindFirstFile() and FindNextFile()) or even has a small idea on how to do that. thanks.
2
Airslash
by: Airslash | last post by:
Hi, I'm currently working on a function to delete a folder and its files + subfolders. The function currently works for the target folder, but refuses to delete the subfolders and files in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.