in reply to Re: Replace duplicate files with hardlinks
in thread Replace duplicate files with hardlinks
You are right. At first I thought it was a bug in my script, but then I realized that, as there is no way of recognizing a hard link as such, repeated runs of the program on the same directory will report identical results.
I think the *n*x notion of "symlinks" ports to MS-Windows as "short-cuts", so this may be somewhat more portable, but you'd have to look at the sources for F::F::Dups to see whether it picks up on the difference between a data file and any sort of link.
I checked the source of the module, and it only reports real duplicates. Soft links are discarded by the -f file test, wich returns 0 if the "element" is a directory or a soft link.
However, I'm only now thinking about the posibility of creating soft links and the consequences that I might have. I hadn't considered the possibility of running the script in a non-unix envirnomnet either.
And that brings up another point you might want to test with your script: does F::F::Dups know enough to leave symlinks alone, or does it follow them when looking for dups?
Luckily enough, it doesn't.
F::F::Dups uses File::Find with somewhat default options, and in that regard the default is not to follow links. So the problem that you most correctly point out is not an issue here (but thanks for mentioning it because I hadn't considered it!).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Replace duplicate files with hardlinks
by repellent (Priest) on Aug 11, 2008 at 04:04 UTC | |
by bruno (Friar) on Aug 11, 2008 at 04:55 UTC | |
|
Re^3: Replace duplicate files with hardlinks
by repellent (Priest) on Aug 11, 2008 at 16:28 UTC | |
|
Re^3: Replace duplicate files with hardlinks
by bruno (Friar) on Aug 10, 2008 at 22:16 UTC |