[Linux-disciples] Paranoid file locking
Stephen R Laniel
steve at laniels.org
Fri Mar 25 19:28:43 EST 2005
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?
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
More information about the Linux-disciples
mailing list