On Thu, 05 Aug 2004 20:53:12 -0400 (EDT) Howard Siegel
<hsiegel(_at_)panix(_dot_)com> wrote:
File and record locking is part of RMS (Record Management
Services) which is the interface to the file system. It
will allow you to specify exclusive write access to the
file or records in the file when the file is openned. If
another process tries to open the file for exclusive
write access, it will get back an error and it is up to
that process to decide to abort or wait and retry. The
upshot being that the file system itself maintains the
lock status, not the presence/absence of an auxilliary
lock file.
- h
I hate to say it, but versions of MS Windows built around the NTFS file
system (NT, 2K, XP) also have this ability. It's broken, but it's there.
Well, not any more broken that other parts of the OS. If a process opens a
file with write exclusivity then another process wants acess the second
process will add it's handle to a queue -- effectively saying "I'm next for
this file". But the second process will sometimes never come back to
actually WRITE to the file after the first releases it. It leaves its tag
in the queue so no other process will take precedence and grab the file
though. So, you end up seeing "File Sharing Violation" errors as more and
more processes queue up behind the one that's forgotten it wanted the file
in the first place.
And the only way to clear the waiting queue -- you guessed it -- reboot the
machine, the standard way to clear most Windows error states.
That's one drawback of file system/kernel level locking. Using dotlock
methods one can set a max time to wait in a well written program and have
the lockfile deleted after that amount of time so other processes can gain
access. And if the program isn't well written but you are looking at logs
and notice programs trying to access a file that's been locked for three
hours you can go delete the lockfile by hand without rebooting the whole
system to clear a kernel level flipped bit.
Gerald
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail