A
Admin
I have a program that needs to have a couple things happen.
First, the file needs to constantly be updated with new information.
Because the function in which I do this is not always running, I need
to be able to close the file and re-open it.
I know this can be accomplished (in theory) by the following, but for
some reason, I don't have any luck with it. I can't get the program
to open the file, write to it, close it, then re-open it for more file
writing.
I have some sample code, but it's all really basic.
// to open
outfile.open(timestamp_file_name.c_str(),ios:ut | ios::app);
// to close
outfile.flush();
outfile.close();
Can someone help me solve this problem. I've had to make some pretty
interesting side steps to get around this problem before, and now it's
more of a problem to make the work around.
Any help is appreciated,
Kris
First, the file needs to constantly be updated with new information.
Because the function in which I do this is not always running, I need
to be able to close the file and re-open it.
I know this can be accomplished (in theory) by the following, but for
some reason, I don't have any luck with it. I can't get the program
to open the file, write to it, close it, then re-open it for more file
writing.
I have some sample code, but it's all really basic.
// to open
outfile.open(timestamp_file_name.c_str(),ios:ut | ios::app);
// to close
outfile.flush();
outfile.close();
Can someone help me solve this problem. I've had to make some pretty
interesting side steps to get around this problem before, and now it's
more of a problem to make the work around.
Any help is appreciated,
Kris