I have an automated test running on my program that generates some large MPG files along with other files. After running the test, I have the script clean up after itself. The other files (a mix of binary and text files) are removed with no problems. The MPG files, however, don't get deleted. If I try and manually delete the MPG files from explorer after the test has run, they are removed from the explorer window only to reappear a few seconds later. Process explorer shows that they are being used by explorer.exe. Eventually, I am able to remove these files. Any idea why this is happening?
A:
It sounds like something is still hanging on to a reference to the file. Is it possilbe that you have shadow copy set up and it is trying to archive the file?
palehorse
2008-10-15 17:36:11
+2
A:
Is it possible that Explorer is holding onto the files to generate thumbs.db and perform its other work? I ask that because I've noticed considerable lag as Explorer evaluates every movie file in my media directories, even when in Details view. (You can tell, because the address bar of that Explorer window will become a progress bar, slowly -- ever so slowly on my box at home -- turning green.)
Is this behavior still exhibited if no Explorer windows are open to the appropriate directory?
John Rudy
2008-10-15 17:40:43
Turns out that the directory for file output was the same directory where the script resided. So even though no explorer window was open, the command prompt was open to the directory. Moving the output files to a different directory seems to have fixed the problem. Thanks.
bsruth
2008-10-15 18:00:59
That makes sense; I didn't even realize that the command prompt being open to that directory would be fundamentally the same. Good thing for me to remember if I ever run across this kind of issue! Thank you for the extra info!
John Rudy
2008-10-15 18:02:39