PDA

View Full Version : c++ how to clear file contents in use


nightthepope
03-07-2005, 01:59 PM
Hi,

there is a program that outputs to a txt file over time.
and I have a program that reads from the file.
but I would like to clear the file contents because the file is getting large.
but it seems the other program is still using it and it won't let me delete the file or modify its contents.

is there a way that I can delete the entire file or merely its contents without turning off the program that is appending to it?

aman
03-07-2005, 03:46 PM
I could be wrong, but I think that unless the other program has opened the file in shared mode, you may be out of luck.