Re: How to find Latest n files from a directory using VC++
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Mon, 28 Nov 2005 03:55:50 -0500
jignesh2680@xxxxxxxxx wrote:
Dear Experts ,
I am developing an application in VC++ 6.0 .
My application is releated with reading and writing large numbers of file .
i have one directory say [C:\Test] which contains 10,000 files and may be more .
i want to know how can i find latest 20 files that is created in C:\Test .
I am using CFileFind and CFileStatus to find file and to Get Creation time of file
but i think as my content of directory increases it will comsume more time for searching latest 20 files ......
Can anyone tell me how to come around this searching problem... is there any readymade class available that gives this solution.
Thanks in Advance ,
Regards
Jignesh Patel
Surat
Can your program be running when the files are created? The only way to avoid the large search would be to detect when new files are written. You can use ReadDirectoryChangesW() to receive notifications when new files are written.
-- Scott McPhillips [VC++ MVP]
.
- References:
- How to find Latest n files from a directory using VC++
- From: jignesh2680
- How to find Latest n files from a directory using VC++
- Prev by Date: Re: Setwindowpos()-problem.Moving control is not happening.
- Next by Date: Re: DrawText with DT_WORDBREAK: DT_CALCRECT computes too small a height
- Previous by thread: How to find Latest n files from a directory using VC++
- Next by thread: Re: How to find Latest n files from a directory using VC++
- Index(es):
Relevant Pages
|