Driving Me Insane


7zark7

Member
Joined
Nov 24, 2005
Messages
124
I am sure i am doing something stupid, but i cannot get anything written to my file... can somebody offer some advice , here is my code. it never falls into error clauses but does not write to the file...

OutFilePtr = fopen("/mnt/sd/ebook/debug.txt","w");

if(!OutFilePtr)
{
//do something about the error.

}


int i = fprintf(OutFilePtr,"Debug ouput!\n");

if(i== -1)
{
// do something about the error.
}

fflush(OutFilePtr);
fclose(OutFilePtr);
 
Don't forget writes are cached, and not actually written to the sd until either the file system is told to sync, or it's unmounted.

So, try adding a call to sync() after your fclose...
 
ha ha , you haved no idea how mad this was driving me ..... working now thanks!
 
Back
Top