How to I lock a file ?

fowlertrainer at anonym.hu fowlertrainer at anonym.hu
Fri Nov 28 12:30:01 CET 2003


Hello python-list,

  On windows I try with this:

    import os
    f1=file('a',"w+",os.O_EXCL|os.O_WRONLY)
    f1.write("0")
    f2=file('a',"w+",os.O_EXCL|os.O_WRONLY)
    f2.write("1")
    f1.close()
    f2.close()

 But it is not working...

 So how to I lock this file to prevent from next opening ?

Thanx.

-- 
Best regards,
 fowlertrainer                          mailto:fowlertrainer at anonym.hu






More information about the Python-list mailing list