On Wed, Apr 07, 2010, Tony Cappellini wrote: > > I need to write a program which copies some dlls from one location > to another. However, if any applications which use these dll's are > running, Windows won't let the dll copy complete, until the apps > which have the dlls loaded have terminated. I'm looking for a way > to scan/probe to see if any apps are running which have these dll's > loaded. How would I go about this with Python ?
Here's my company's code: # Open file in read-only exclusive mode, then immediately close; if anything # has the file open, will fail h = win32file.CreateFileW( fname, win32file.GENERIC_READ, 0, # exclusive access None, # no security attrs win32file.OPEN_EXISTING, win32file.FILE_FLAG_NO_BUFFERING, None ) h.Close() -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "...string iteration isn't about treating strings as sequences of strings, it's about treating strings as sequences of characters. The fact that characters are also strings is the reason we have problems, but characters are strings for other good reasons." --Aahz _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32