Tuesday, June 17, 2008

LibOGC - libfat

Tested file operation with libfat.

#include

// Initialise libfat
fatInitDefault();

// Open a file for reading
FILE *file = fopen("myfile.txt","wrb");

char buffer[] = {"This is a test\n"};

fwrite(buffer, 1, sizeof(buffer), file);
fclose(file);

File will be saved in the application directory (current directory) on sdcard.
So /apps/test/myfile.txt

Awesome and pretty.

No comments: