Re: Setting an exclusive lock on a file

2009-03-29 Thread Diez B. Roggisch
Eugene Perederey schrieb: Hi all, I want to set an exclusive lock on a file so other processes wouldn't be able to write to it. So I write import fcntl fd=open('myfile','w') fcntl.lockf(fd, fcntl.LOCK_EX) fd.write('some bytes') fd.close() But it turns out that my script doesn't write anything t

Re: Setting an exclusive lock on a file

2009-03-29 Thread Diez B. Roggisch
Eugene Perederey schrieb: Hi all, I want to set an exclusive lock on a file so other processes wouldn't be able to write to it. So I write import fcntl fd=open('myfile','w') fcntl.lockf(fd, fcntl.LOCK_EX) fd.write('some bytes') fd.close() But it turns out that my script doesn't write anything t

Setting an exclusive lock on a file

2009-03-29 Thread Eugene Perederey
Hi all, I want to set an exclusive lock on a file so other processes wouldn't be able to write to it. So I write import fcntl fd=open('myfile','w') fcntl.lockf(fd, fcntl.LOCK_EX) fd.write('some bytes') fd.close() But it turns out that my script doesn't write anything to file whereas other process