http://qs321.pair.com?node_id=1214716


in reply to Safely read/write a file simultaneously

Whether or not rename(2) will be atomic depends very much on the operating and file systems. Unfortunately File::Copy's move adds another layer of uncertainty, since it doesn't guarantee to use rename under the hood. But then again, when the rename operation is atomic, it's a great way for updating a file with one writer and many readers (multiple writers still need to coordinate). You might be interested in my module File::Replace.