Re: Compare files for 'find duplicates' script
Re: Compare files for 'find duplicates' script
- Subject: Re: Compare files for 'find duplicates' script
- From: Doug McNutt <email@hidden>
- Date: Mon, 21 Nov 2005 10:38:48 -0700
At 16:51 +0000 11/21/05, pete boardman wrote:
>My explorations haven't yet turned up an easy way to do this. I found some interesting shell commands (eg md5, diff), but realised that they couldn't easily cope with some files (such as fonts) that appear to 0 bytes big. Tthe Finder reports the correct size for these.
That sounds as though AppleScript is not ignoring resource forks of files the way un-hacked UNIX tools do.
I set up this alias in my .tcshrc start up file for Terminal
alias files ls -lF \*/..namedfork/data \*/..namedfork/rsrc
The effect is to emulate the MPW command "files" which does things the Apple HFS+ way. You might try just the ls part of it on a directory which is giving you trouble - Fonts for instance.
Adding /..namedfork/rsrc to a file name should provide something that can be compared using UNIX tools. For a complete script you would have to compare both resource and data forks for each file being compared.
Watch out for files that contain resource forks at Apple's convenience but are actually quite the same. For instance, if you ask Finder - Launch Services - to open a particular file with some application 50 kB or so of resources will be added to contain the icons for the selected application. It's not part of the file unless the original had a resource fork and even then it's not fair to compare the resource forks in binary.
You could also worry about metadata. If you change the type or creator of a copy of a file does that remove the "duplicate" property in your mind?
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden