[Tutor] how to check if a file is being used by another person or
application before writing to it?
Jeff Peery
jeffpeery at yahoo.com
Tue Nov 30 20:51:46 CET 2004
hello,
I need to read/write from/to a file although I do not want to read/write a file that is being used by another person or application. is there a way to check if a file is already open by another person? this way I could use some sort of clock to periodically check if a specific file is open and when it isn't open then I could do what I need to it.
similarly is there a way to check if a file has been written to? I suppose I would do something like periodically check the size of a particular file and if it increased then I would know it was written to. I didn't see anything in the python documentation for geting the size of a file. how is this normally performed?
thanks.
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20041130/00321dd9/attachment-0001.html
More information about the Tutor
mailing list