Find touched files since a specific timestamp

Hi,

Given the name of a folder, what's the best way to find 
the list of files (include files in sub-directories) that 
were changed since a specific timestamp?

I tried to add the list of files to a CStringArray and 
then sort them.  But it took a while to process some 1000 
files.  There must be a better way.  Please advise.

Best,
Isaac
http://www.globalrendering.com


0
anonymous (74722)
10/21/2003 11:25:00 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
395 Views

Similar Articles

[PageSpeed] 37

Which sorting method have you used? qsort does 1000 sorting in several ms.
Anyway, if you want to get files in a date range, just check date before
adding to array, use CFileFind.


--
Igor Green,
Grig Software.
www.grigsoft.com
Compare It! + Synchronize It! : files and folders comparison never was
easier!


"Isaac Cheung" <anonymous@discussions.microsoft.com> wrote in message
news:049701c3982a$8c5bca20$a401280a@phx.gbl...
> Hi,
>
> Given the name of a folder, what's the best way to find
> the list of files (include files in sub-directories) that
> were changed since a specific timestamp?
>
> I tried to add the list of files to a CStringArray and
> then sort them.  But it took a while to process some 1000
> files.  There must be a better way.  Please advise.
>
> Best,
> Isaac
> http://www.globalrendering.com
>
>


0
grigsoft (56)
10/22/2003 6:36:30 AM
This should get you started:

CFileFind fileFind;
CTime time = ?????;
BOOL bFound = fileFind.FindFile(...);
while (bFound != FALSE)
{
    bFound = fileFind.FindNextFile();

    CTime timeChange;
    fileFind.GetLastWriteTime(timeChange);
    if (timeChange > time)
        // add to list
}

"Isaac Cheung" <anonymous@discussions.microsoft.com> wrote in message
news:049701c3982a$8c5bca20$a401280a@phx.gbl...
> Hi,
>
> Given the name of a folder, what's the best way to find
> the list of files (include files in sub-directories) that
> were changed since a specific timestamp?
>
> I tried to add the list of files to a CStringArray and
> then sort them.  But it took a while to process some 1000
> files.  There must be a better way.  Please advise.
>
> Best,
> Isaac
> http://www.globalrendering.com
>
>


0
david.crow (132)
10/22/2003 1:15:28 PM
One other thing I accidentally omitted from my post was to check the found
file's attributes to make sure the archive bit has been set.  This and the
date condition must be met before the file is added to the list.

"Isaac Cheung" <anonymous@discussions.microsoft.com> wrote in message
news:049701c3982a$8c5bca20$a401280a@phx.gbl...
> Hi,
>
> Given the name of a folder, what's the best way to find
> the list of files (include files in sub-directories) that
> were changed since a specific timestamp?
>
> I tried to add the list of files to a CStringArray and
> then sort them.  But it took a while to process some 1000
> files.  There must be a better way.  Please advise.
>
> Best,
> Isaac
> http://www.globalrendering.com
>
>


0
david.crow (132)
10/22/2003 1:16:55 PM
Reply:

Similar Artilces: