Mutex a file?

Sheila King usenet at
Fri Feb 15 18:35:35 CET 2002

On Fri, 15 Feb 2002 10:16:19 -0500, "MDK" <mdk at> wrote in
comp.lang.python in article <a4j8o4$mpqo$1 at>:

> The code that you posted is exactly what I need: simple file locking on a
> Windows machine.

Well, good. Although, if it is WinNT, Win2K or (probably ?) XP, there is
a better way to do it that affords more control and doesn't require the
looping to keep trying to acquire a lock on the file.

Be careful that locks should only be held for a very short time.

Good Luck,

Sheila King

"When introducing your puppy to an adult cat,
restrain the puppy, not the cat." -- Gwen Bailey,
_The Perfect Puppy: How to Raise a Well-behaved Dog_

More information about the Python-list mailing list