Its all in the wrong place
No it's not. It's correct to post in one of the programming forums when you think you've found a bug, so that others can confirm it before posting in the bug reports forum. Otherwise, the bug reports forum gets clogged with 'bugs' that aren't bugs at all.I seem to remember BRL actually requested that everyone follow this protocol when reporting bugs. Unfortunately, most people don't follow it and just jump straight into the bug reports forum only to discover the 'bug' is infact a coding error on their part.
Your attitude isn't appreciated or helpful, RaGR.
Anyway, I'm going to look into this issue a bit more as I'm sure when I had the problem I wasn't forgetting to close the files before deleting them. :)
[edit]
I went back to my code I was having a similar problem with and it seems unrelated to your problem afterall, Chalky. I was messing with TTF font files which the system may have still had a handle on so wouldn't allow them to be deleted.
I tried re-creating the problem you're having (using the code you posted) and couldn't do it - the file got deleted. Maybe Floyd's points are worth checking out. I don't know what else to suggest.