views:

518

answers:

2

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
+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
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
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