>You might need a short delay between the fclose() and the erase to let the OS fully commit the close. Of course in that time the file might get opened by something else again...
>
>Can you just empty the content using fchsize()?
Well, what happens is that 4 transactions are initiated at the same time against the server. The first one see that the stylesheet, based on some conditions, need to be replaced. That is usually because the user is switching between IE and NS. However, as multiple transactions are initiated at the same time to the server (from the same user) - that happens when logging in UT - that may well be that during that process beacause as one will erase the file, at the same time, another transaction is already in the loop and tries to erase it again.