madecoste / swarming

Automatically exported from code.google.com/p/swarming
Apache License 2.0
0 stars 1 forks source link

Use Windows Vista restart manager to figure out which process have a lock on files #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
run_isolated's rmtree() tries to kill processes that have a handle to files in 
the directory being deleted. It's a bit crude.

Starting with Vista, there's an official API to do it
http://msdn.microsoft.com/en-us/library/windows/desktop/cc948910.aspx

So the workflow would be:
- Try to delete everything, get the list of files that can't be deleted.
- Use the Restart Manager to figure out the processes.
- Kill them
- Delete everything from the list.

Original issue reported on code.google.com by maruel@chromium.org on 12 Sep 2014 at 2:57