Hi guys, just a quick about fclose or close function. What i am after is to log all the error messges on to a file. But I dont want that file to be written to the hard disk, instead I want this be on the RAM.
The reason is beacause, i dnt have much flash memory on my board. It has just got 16MB flash. And if I keep on logging message , there would a time where it will run out. What I thought of is, since I have lots of primary memory like say 64MB of RAM and board will be on all the time the data will be saved there till the power is supplied.
When power cuts of well you could say the board has been resetted. So for example
Code:
int main()
{
...
fopen();
fputs(...);
fputs(...);
...
return 0;
}
It looks like when I close the file, all the buffered data which i unwrittem to the file be written. Am I right? Or if I dont close the file will all data be in the RAM? As far as i am aware when it reaches main all data will be written to main.
Thanks a lot!
ssharish