[Linux-disciples] Paranoid file locking

Adam Rosi-Kessel adam at rosi-kessel.org
Fri Mar 25 19:59:38 EST 2005


I believe if you rename a file that is otherwise open, no harm is
done--the open file handle isn't linked to a filename.

That doesn't really answer your bigger question, but it does answer your
smaller question.  If you moved a mailbox while it was being written to,
there would be no problem.

On Fri, Mar 25, 2005 at 07:28:43PM -0500, Stephen R Laniel wrote:
> I just renamed one of my files in ~/Mail that procmail
> delivers to, and it occurred to me: what happens if procmail
> was writing to the file at the moment I moved it? I can
> imagine a few ways that procmail and Linux could respond,
> all of them suboptimal. In the worst case, part of the
> incoming message gets written to the old file, part to the
> new; in the best case, *all* of the incoming message gets
> written to *both*. Or are procmail and Linux nicer than
> this? Will they somehow arrive at the correct solution?
> 
> If I'm messing with files, is there any automatic way to
> reduce the possible harm? I'd like to be forward-thinking
> enough to stop every daemon that could possibly affect a
> file before I mess with that file, but I'm not that smart.
> Are there any automatic ways to get around this problem?
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050325/83e33d5b/attachment.pgp


More information about the Linux-disciples mailing list