[python-win32] Calling random Windows function?

Aahz aahz at pythoncraft.com
Sat Oct 24 01:33:11 CEST 2009


On Fri, Oct 23, 2009, Tim Roberts wrote:
> Aahz wrote:
>>
>> Perhaps it would be better to think more strategically.  I don't actually
>> care about the list of open files.  What I care about is a list of files
>> that I want to process and checking whether any of them are open.  What
>> would be the canonical way of doing that on Windows?  It doesn't matter
>> whether it is in batch or file-by-file.
> 
> Wouldn't the least-effort solution be simply to try to open each file,
> and see if the open succeeds?

We used to do that, but it was interfering with other programs.  (It's
similar to backup, and we don't want to interfere with e.g. Excel, which
previously was an issue if someone had an open spreadsheet and tried
saving it while we were uploading it.)

I suppose we could switch to using Volume Shadow Copy, I'm not sure why
we didn't try that earlier.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In the end, outside of spy agencies, people are far too trusting and
willing to help."  --Ira Winkler


More information about the python-win32 mailing list