How to I lock a file ?

Miki Tebeka mikit at zoran.co.il
Sat Nov 29 17:38:47 EST 2003


Hello, 

>     f1=file('a',"w+",os.O_EXCL|os.O_WRONLY)
Have a look at the documentation, the 3'rd parameter to "file" is the buffer size.

>  So how to I lock this file to prevent from next opening ?
Use os.open or the win32all package (with CreateFile).

HTH.
Miki




More information about the Python-list mailing list