Re: Check whether file is being written to

2010-09-23 Thread Nobody
On Thu, 23 Sep 2010 17:55:52 +0200, Diez B. Roggisch wrote: > Last time I checked, file-locking in unix was co-operative. Linux supports mandatory locking, but it's seldom enabled. -- http://mail.python.org/mailman/listinfo/python-list

Re: Check whether file is being written to

2010-09-23 Thread Diez B. Roggisch
Thomas Jollans writes: > On Thursday 23 September 2010, it occurred to loial to exclaim: >> How can I check whether a file is being written to by another process >> before I access it? >> >> Platform is unix. > > As such, you can't. But you can lock the file using the functions in the > fcntl

Re: Check whether file is being written to

2010-09-23 Thread Thomas Jollans
On Thursday 23 September 2010, it occurred to loial to exclaim: > How can I check whether a file is being written to by another process > before I access it? > > Platform is unix. As such, you can't. But you can lock the file using the functions in the fcntl module. -- http://mail.python.org/ma

Re: Check whether file is being written to

2010-09-23 Thread Seebs
On 2010-09-23, loial wrote: > How can I check whether a file is being written to by another process > before I access it? You mean "written to" or "open for possible writing"? It may be possible (with sufficient privileges) to determine that a file has been opened for writing. I don't think you