[python-win32] knowing "file accessed" and "file opened"

Roger Upole rwupole at msn.com
Sat Feb 27 12:28:52 CET 2010


OptiCar wrote:
> Hello,
> i need to know when an updated file has been opened.
> is it possible to watch the "OPEN" and "ACCESS" event with an adaptation
> of the Tim Golden's script ?
> need to work on windows, does pywin32 can ?
> inotify is only for linux
> dazuko can catch on linux
> what can work on windows to see the file open and file access event ?
> 
> Thanks
> 
>          Roche Maxime
> 

You can use the file's SACL to create an audit record in the event log
whenever the file is accessed.
\win32\Demos\security\set_file_audit.py has some sample code
for SACL's.

       Roger



More information about the python-win32 mailing list