Re: How to find Latest n files from a directory using VC++

Tech-Archive recommends: Speed Up your PC by fixing your registry



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]

.



Relevant Pages

  • How to find Latest n files from a directory using VC++
    ... My application is releated with reading and writing large numbers of ... Can anyone tell me how to come around this searching problem... ... Surat ...
    (microsoft.public.vc.mfc)
  • Re: BMP/JPG/GIF library in Ada?
    ... > # Does anyone have a library for reading, writing and manipulating image files ... I tried searching on AdaPower, ...
    (comp.lang.ada)
  • Re: BMP/JPG/GIF library in Ada?
    ... > # Does anyone have a library for reading, writing and manipulating image files ... I tried searching on AdaPower, ...
    (comp.lang.ada)
  • Re: evaluating posts with stars
    ... Try to find an answer by searching the Web. ... Try to find an answer by reading the manual. ... Or do you know these sentence of Shopenhauer: "Buying books ... Try to find an answer by asking a skilled friend. ...
    (comp.lang.java.programmer)
  • Re: The future of IBM Mainframes [just thinking]
    ... Unix newsgroup, some 25-30 years ago: "If you ask a question, you get several responses: some flaming you for not knowing the answer in the first place, some flaming you for asking the question the way you asked it, and some flaming you for trying to do it that way in the first place. ... Try to find an answer by searching the archives of the forum you ... Try to find an answer by searching the Web. ... Try to find an answer by reading the manual. ...
    (bit.listserv.ibm-main)