laziness, impatience, and hubris | |
PerlMonks |
Re: about link()by tobyink (Canon) |
on Feb 18, 2012 at 21:21 UTC ( [id://954807]=note: print w/replies, xml ) | Need Help?? |
The behaviour you've seen editing your text file is to be expected. Hard links are not commonly used on Windows. (They're not even that common in Unix - soft links seem to be more usual.) Thus some Windows software might not expect to be dealing with linked files and accidentally end up breaking the link - I'm guessing that's what's happening with your image editor. Example scenario:
Step 4b results in y.jpeg no longer being a link to x.jpeg. This saving via a temp file is quite common in software that deals with potentially large files. There's a good reason for it - consider what happens if the software crashes part way through the saving process. If it did a straight overwrite of y.jpeg and crashed part way through, all you'd have is a corrupt image. But using the temp file, if it crashes during saving, you've at least still got your original version to go back to. Anyway, answers to your questions:
(ObPedantry: before anyone points it out, obviously when I say that hard links are not often used, I am ignoring the fact that the "original name" of the file is itself technically a hardlink. And that because directories have hardlinks to their parents and themselves, most directories end up with multiple hard links pointing to them.)
In Section
Seekers of Perl Wisdom
|
|