From: Brian Candler Date: 2009-07-17T04:10:09+09:00 Subject: Re: making sure a file isn't being written/copied before moving Paul Archer wrote: > Can someone suggest an easy (or at least reliable) way to make sure > that > any file I'm about to modify isn't being touched by another program? As you said yourself: rely on the atomic semantics of the filesystem. Rename it to an extension which the other program will not recognise, or into another directory which the other program won't be looking in. This is how Maildir works, so maybe reading up on the semantics of Maildir will help you. http://www.qmail.org/qmail-manual-html/man5/maildir.html -- Posted via http://www.ruby-forum.com/.