Robin Becker wrote:
On 05/03/2020 16:04, Eryk Sun wrote:
On 3/5/20, Robin Becker <ro...@reportlab.com> wrote:
I want to be able to read a windows file which is being periodically written
by another process.

I'm having difficulty reconciling this sentence with the subject line.

OK I want to read the (small) file completely. The other process may try to re-write the file while I am reading it. I thought that denying them write permission for the short time I have the file open for reading might make incomplete files less likely. So far the applications seem to be able to operate in this fashion and the small files seem to be complete.

Remember that the "deny write" permission only applies to opens. And if you have "deny write" set, the other open will fail -- it won't just delay.

You can always use win32file.CreateFile directly, and bypass the Python filtering.  Alternatively, and perhaps more hacky, you can use subprocess to copy the file to a safe temporary name.

--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to