On 05/03/2020 14:19, paul.kon...@dell.com wrote:


On Mar 5, 2020, at 5:42 AM, Robin Becker <ro...@reportlab.com> wrote:


[EXTERNAL EMAIL]
I want to be able to read a windows file which is being periodically written by 
another process. I created a small extension ...

that seems to work, but I wonder if there's an easier pure python way to do 
this. Looking at the docs I see O_EXCL, but the _SH_DENY flags seem to be 
absent.

If the _fsopen function is present then you might try passing the numeric value 
of those flags.  If the real issue is the lack of a Python wrapper around 
_fsopen, look at the ctypes module.  That offers a simple way to wrap existing 
shared library (DLL) APIs to make them visible as Python functions, without the 
need to write your own extension modules.  The documentation for ctypes in the 
Python library manual is quite good, and includes Windows specific examples.

        paul


yes I thought about doing this when the app moves to python 3.x; I'm only using the deny write value so passing the integer could work.
--
Robin Becker
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to