[python-win32] FileWatcher

Mike Driscoll mdriscoll at co.marshall.ia.us
Mon Apr 28 15:28:00 CEST 2008


Pierre-Yves Delens wrote:
> Bonjour,
>
> in the context of CAD management (layersmanagement, etc...),
>
> we are storing our Layers management in a reference.dwg file, for 
> obvious reasons.
> But some aspects of this management have to be maintained in 
> alphanumeric format.
>
> Therefore
>
> we need to trigger each time this reference.dwg file is modified.
> This trigger would launch a small exe our py script,
> so that we can extract datas from it (layers definitions actually), 
> and integrate them in a database (SqLite ~Python).
> We should therefore be able to monitor this file.
>
> Can Python, can PythonWin help me to do that?
> Could you give me the [beginning  of ] a clue?
>
> I read through the book 'Py progamming on Win32', but I didn't find this.
> Although I guess that a Win 'service' (the topic is in the book) 
> should be created.
>
> I found about "FileWatcher DLL" which is what we need, butthisis in 
> context of C# and IronPython. I was hoping to find a shorter way 
> between Python and the file-Sytem. Is there some kind of FileWatcher 
> DLL accessible from Pywin32?
>
> Thanks on forward.
>
> Yours
> -- 
>
> __________________________________________________________________
> pour P-Y Delens sprl, Bureau d'Architectes,
>
> Pierre-Yves Delens, ir-arch.
>
>   
Hi Pierre-Yves,

I've used Tim Golden's folder watcher script to do this sort of thing. 
You can check it out as well as a couple of other methods on his site: 
http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html

It uses various parts from the pyWin32 package, so be sure to download 
that.

Mike


More information about the python-win32 mailing list