On Wed, 19 Mar 2008 12:34:34 +0000, Duncan Booth wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> This whole approach >> assumes that Windows does the sensible thing of returning a unique > error >> code when you try to open a file for reading that is already open for >> writing. >> >> > So how would you use a file to share data then?
I see I was a little unclear. What I meant to say was that I assumed that Windows returned a specific error code of "file is busy" as opposed to "you don't have permission to access this file right now" without specifying whether this is a permanent permissions error or a temporary file busy error. > By default Python on Windows allows you to open a file for reading > unless you specify a sharing mode which prevents it: But the OP is talking about another process having opened the file for WRITING, not reading. It's that other process that has exclusive access, and the OP was trying to determine when it was safe to attempt opening the file according to whether or not it was still growing. -- Steven -- http://mail.python.org/mailman/listinfo/python-list