I am using the latest devkitARM version r43, installed via the installer
All is working fine and nicely. However i got a problem with writing a file to the filesystem.
For this is am using the nitrofs\nitrofsdir example.
After a make i start the nds file up with DeSmuMe 0.9.10 and the files that are include are read nicely. If i use the build in nitrofs viewer i can find the files.
But when i try to write a file to the file system the file doesn't show up in the viewer. I've tried to create the file and to use an already existing file. Both action these me that the where succesful but nothing appears.
The example already has a file1.txt include and i try to overwrite that one
This is one of the many code variants i tried but till now not succes.
Could anyone help me with this?
Code: Select all
//---------------------------------------------------------------------------------
void TestWrite()
//---------------------------------------------------------------------------------
{
FILE * fp;
fp = fopen ("file1.txt", "w");
fprintf(fp, "%s %s %s %d", "We", "are", "in", 2015);
fclose(fp);
}
char incoming_buffer[256];
//This buffer is filled earlier and a check comfirms that it holds data.
/Create a temporary Var in the FAT system to control saving
FILE* save_file;
//Open the file you are saving to or create it if it is not present
save_file=fopen("evntgrps.txt", "wb"); //wb = create/truncate & write
//Write data into the file
fwrite(&incoming_buffer, 1, sizeof(incoming_buffer), save_file);
//Close the file
fclose(save_file);