I'm having some problems with Tim Golden's file_handles.py [*] (details below), and it occurs to me that perhaps I should start over and express my requirement more broadly and see if someone has a more "Windows appropriate" solution: all I really care about is, given a specific filepath, whether any other program is currently using the file.
This would work: h = win32file.CreateFile(fname, win32file.GENERIC_READ, 0, None, win32file.OPEN_EXISTING, win32file.FILE_FLAG_NO_BUFFERING, None) but I would prefer not to create an exclusive lock, even temporarily. Suggestions? There are two problems I'm having with file_handles.py: * It's not returning all open files; for example, it doesn't list this: >>> f = open(r'\tmp\x.txt') * The threading code is not set up for re-use (i.e. each call to main() creates 20 threads and never releases any) In trying to fix the second problem, changing the threading setup gives zero "File" results. In looking over our old open file handle .EXE, I realized that it uses a special driver called "ListOpenedFileDrv.sys" and that's the source of AVG flagging our .EXE as malware. I have no idea what calls the .SYS uses to get open files. [*] http://winsys.googlecode.com/svn/trunk/random/file_handles.py -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ The best way to get information on Usenet is not to ask a question, but to post the wrong information. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ The best way to get information on Usenet is not to ask a question, but to post the wrong information. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32