[python-win32] How to Tell Windows that a file Changed

Tim Golden mail at timgolden.me.uk
Fri Mar 16 16:41:08 CET 2007


Gregory Piñero wrote:

> I have a program that puts files to be OCR'd into a directory where
> Omnipage sees them and then performs OCR on them.  Everything was
> working great, until yesterday when Omnipage stopped "seeing" files
> added to the folder.
> 
> What's odd though is that if I manually place a file in the folder
> Omnipage sees it.  So I'm wondering if I can use Python and (the
> windows API) to tell the OS that I've placed a file in the folder?
> (I'm on Windows 2000 professional if that matters)

Well, it's bizarre behaviour for sure, but in case it helps you
might try the SHChangeNotify routine exposed in the pywin32
modules. It's one of those does-everything functions MS seems
to love. The docs, such as they are, are here:

http://tinyurl.com/f5olb
(msdn link)

but I suspect you'll have to poke around the web to find
examples of the parameters.

TJG



More information about the Python-win32 mailing list