Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindFile By Time

Status
Not open for further replies.

DSTR3

Technical User
Jan 21, 2005
41
0
0
US
I'm using C++ with Windows 7. I'm trying FindFirstFile by time, and I want to find a file that is less than 20 seconds old. I have the find part I think, but I am having difficulty doing it by time. any help is appreciated. Thanks.

HANDLE hFile;
LPFILETIME lpCreationTime,
lpLastAccessTime,
lpLastWriteTime;

// Find the file.
hFile = FindFirstFile( *.txt,
GENERIC_READ,
0, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL );

GetFileTime(hFile, lpCreationTime <= currenttime);
DeleteFile(*.txt);

CloseHandle(hFile);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top