F
Freddy
Hi,
I have a C/C++ program..
I'm using a certain file to dump lots of computed numbers in it because
I might need to check them later on...so the only way I was able to do
that is by "appending" all the data to that file...because if I use the
"write" ("w") function..everytime the iteration takes place it will
delete the previous data.
if I run the program X number of times...that file is just being
appended..and its size is becoming huge...and I have to always remember
to delete the old file before I run my program again in case I needed
to check those number..
so my question is: is there a way I can delete the old file only when I
start executing the program again....I mean I want to dump all the data
of one run in that file..but when I run the program again I want to
delete the old file...and let it recreate it again...
what I think that it would help..is that I introduce a line where I
delete that file at the beginning when I am initializing all my
original data and then when the program hits its usual point the file
is then recreated and the data appended...
how can I do that, is there such a thing in C or C++ (C
preferrably)...thank you for your help...
Freddy
I have a C/C++ program..
I'm using a certain file to dump lots of computed numbers in it because
I might need to check them later on...so the only way I was able to do
that is by "appending" all the data to that file...because if I use the
"write" ("w") function..everytime the iteration takes place it will
delete the previous data.
if I run the program X number of times...that file is just being
appended..and its size is becoming huge...and I have to always remember
to delete the old file before I run my program again in case I needed
to check those number..
so my question is: is there a way I can delete the old file only when I
start executing the program again....I mean I want to dump all the data
of one run in that file..but when I run the program again I want to
delete the old file...and let it recreate it again...
what I think that it would help..is that I introduce a line where I
delete that file at the beginning when I am initializing all my
original data and then when the program hits its usual point the file
is then recreated and the data appended...
how can I do that, is there such a thing in C or C++ (C
preferrably)...thank you for your help...
Freddy