Avoiding problem of overwriting files which are in use

Posted by zaf on Stack Overflow See other posts from Stack Overflow or by zaf
Published on 2010-04-06T10:03:19Z Indexed on 2010/04/09 9:03 UTC
Read the original article Hit count: 310

For example on a high traffic web server.

To reduce problems when switching a file I usually rename the old file out and then rename in the new file.

I was told some time ago that renaming a file does not change the 'inode data' so that processes reading the file can keep doing so without glitches. And, of course, rather than copying in the new file it is faster and safer to rename a temp copy.

Is this still best practice and if not what do you do?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about filesystems