laziness, impatience, and hubris | |
PerlMonks |
Re^2: Best practices for modifying a file in place: q's about opening files, file locking, and using the rename functionby 0xbeef (Hermit) |
on Nov 03, 2006 at 12:01 UTC ( [id://582061]=note: print w/replies, xml ) | Need Help?? |
As a side-note, it is rename() that does not work across file systems. The "mv" command itself actually acts as a wrapper when the source / destination are on different file systems. Depending on the UNIX implementation, there are some considerations that may arise when moving a file across filesystems:
1) The source file is copied to the target filesystem and then deleted. It is roughly equivalent to "rm -f DEST && cp -PRp SRC DEST && rm -rf SRC". Hence the Cookbook warning on rename() across file systems. The "mv" command actually does work across filesystems on modern UNIX systems, since it is a requirement of IEEE Std 1003.1-2001.
Regards,
In Section
Seekers of Perl Wisdom
|
|