| Each unique file on the backup is a file once and only once, and every other time in the backup, appears as a link.
So, instead of processing all files, simply process real files, and ignore links altogether (done with a simple UNIX 'file' test). Go through the backup reverse-chronologically, and you're guaranteed to always process the newest version of a file first.
Edit: Hmmm... I just thought about my algorithm, and it may be severely flawed... tee hee... if you only process all real files and skip links, then you'll end up having to touch all files in the backup... not very efficient.
With the UNIX 'find' command, you can use the -f switch to ignore symbolic links. You could run the UNIX 'find' command once on your backup drive at the beginning of the program, printing out all paths to all real files. You could then parse this list of files and do your processing.
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.4 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com
Last edited by ElDiabloConCaca; March 24th, 2008 at 02:23 PM.
|