3 ms·
Or close the other program. Also, "You cannot force the other program to release its grip on the file; the workaround is to set the "pending delete" flag for t
by SAI_Peregrinus 7y ago
Or close the other program.
Also, "You cannot force the other program to release its grip on the file; the workaround is to set the "pending delete" flag for the file and schedule a reboot. " is somewhat wrong. You can close the handle the other program holds on the file, it just might crash that other program.
- cesarb 7y ago> You can close the handle the other program holds on the file, it just might crash that other program. It might do more than just crash that other program. Some other component within that program might open a new file (or even things which are not really files), and happen to get the same handle you had just closed (once the handle is closed, its number can be reused). Then the original component finishes what it was doing and closes the handle; the second component thinks it's still open. A third component opens a new file, and again gets the same handle. Now the second component tries to write to the handle (it might be something like a log file), and the write goes to the wrong place. Force closing a handle on a different process leads to undefined behavior, and as always with undefined behavior, anything can happen. Raymond Chen also has an article about this: http://technet.microsoft.com/en-us/magazine/2009.04.windowsconfidential.aspx http://technet.microsoft.com/en-us/magazine/2009.04.windowsc...