in reply to Re: symbolic/hard links system calls
in thread symbolic/hard links system calls

The system call to rename a file is often seen and assumed to be atomic (and sometimes even guaranteed as such); that is, different processes can observe this mechanism and never see the system "halfway done" with the renaming of the file. This is pretty extraordinary if you realize how many bits of data actually do need to be updated when moving "bar/foo" to "../baz/foo".

If the system had to transfer the whole content of the (potentially large file) from one block device to another block device, it's not likely that the system could continue to guarantee atomicity. Monitoring processes would either notice it is "half done" (file in both places or in neither place), or the process would end up waiting for a huge amount of time when all it wanted to see is whether a file existed or not.

This whole question is a bit of a sidebar-- it's about Un*x or OS design, not about perl in the least.

--
[ e d @ h a l l e y . c c ]