Check whether file is being written to

Thomas Jollans thomas at jollybox.de
Thu Sep 23 11:26:09 EDT 2010


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.



More information about the Python-list mailing list