|P is for Practical
smart way of scanning hard drive for file & folder changesby Foggy Bottoms (Monk)
|on Jul 31, 2003 at 09:59 UTC
Foggy Bottoms has asked for the wisdom of the Perl Monks concerning the following question:
Monks of Nepal and abroad, good morning, I've been wanting to scan my hard drive to find files & folders that'd changed (ie created/modified/deleted). There's a simple of scanning the entire drive and checking to see whether last modified dates have been changed - but it's very time consuming.
Hence, I thought of another way : firstly there's no need to scan if no changes have been made. So a disk scan should only be triggered when a change is detected - that bit was easily solved with Win32::ChangeNotify->new("c:\\",1,"LAST_WRITE");. However this bit doesn't tell me what's changed or where.
Therefore I thought of using a folder's last accessed property, but it so happens that this property doesn't give a complete timestamp - hence it's not precise enough. As for the modified property of a folder, it is not reflected up in a folder tree : if a change occurs 3 folders down in depth then only the directly parent folder is affected.
I'm basically stalling at this point - on one hand I've got this great tool but it returns a "crappy" timestamp and on the other hand I have this really complete timestamp but unfortunately, it's not being reflected on parent folders.
There is some hope however with
FindFirstChangeNotification, a C++ method...
Has anyone ever wanted to look up modified files in an efficient way ? Has anyone advice I could use, tips, or help ?
Thanks so much guys...