473,857 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Get The Files datewise using FindFirstFile Function

23 New Member
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 6471
687 Contributor
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
849 Recognized Expert Contributor
I believe FindFirstFileEx allows for more selective searching, but I've never looked at its docs...Google is your friend.
Sep 3 '08 #3
23 New Member
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
23 New Member
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
687 Contributor
Anybody is there to help me in this problem?
You must sort them by yourself - by name, date or whatever.
Sep 11 '08 #6
2 New Member
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 GetFileAttribut esEx on each file. This can populate a WIN32_FILE_ATTR IBUTE_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

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 C:\Temp" 'how to specify directory? Do I need to use the Windows API? Private Declare Function FindFirstFile Lib "kernel32 Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As
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 extracted files to a specified directory? I can use the following: system("move *.* c:\directory"); However, this will move my program. I end up having to call system for every
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 name with an IP address like: \\\shareddrive\myfiles\*.txt FindFirstFile returns an error(when it's valid). I can use CreateFile with the IP address as a server name succesfully and do a "dir", but it's the FindFirstFile that fails. Is...
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 names only. Any help is appreciated. -Rups
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 = Environ$("COMSPEC") sExe = Left(sExe, Len(sExe) - Len(Dir(sExe))) sExe2 = sExe & "ftp.exe -s:" & Q & sScrFile & Q
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 solve with the framework. I am working with file paths that exceed that MAX_PATH ANSI limitation in the framework. I have to Windows API Unicode functions.
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; using System.Drawing;
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.
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 subfolder. When I debugged the code it returned value 1024 n the SHFileOperation function. I have no idea what it means. anyone could tell me why the function is not deleting it's subdirectory?
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.