Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Overwrite files in place via perl script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Overwrite files in place via perl script
Authored by: lenbudney on Dec 15, '04 09:54:11AM

I didn't know that cp preserved the destination inode. It's not in the man page; a web search turns up only a few hits that mention this tidbit. Thanks much for pointing it out!



[ Reply to This | # ]
Overwrite files in place via perl script
Authored by: CarlRJ on Dec 15, '04 02:18:33PM

It's not like cp does some special magic to preserve the destination inode, rather it's inherent in the way Unix works: cp simply opens the source file for reading, opens the (existing) destination file for writing, and copies bytes from one to the other. The only way to end up with a different inode for the destination file would be for cp to open/write an entirely new file, and then move the new file on top of the old file (but that's not what cp does).



[ Reply to This | # ]