included "fsee.h" void test(void) { FILE f; BYTE c; BYTE filename[12]; //Initialize file system. fsysInit(); //Copy the file name to the filename array. Terminating NULL is also copied strcpypgm2ram((char*)filename, (ROM char*)"myfile.txt"); f = fileOpen(filename, 0); //Open the given file if (f == FILE_INVALID ) { //File not found, take action } else if ( f == FSYS_NOT_AVAILABLE ) { //File System not available } else { while (1) { //Check if file has reached end if ( fileIsEOF(f) ) { fileClose(f); //End of file, take whatever action is required ................ break; } //Read byte from file c = fileGetByte(f); //Check if error occured if ( fileHasError(f) ) { fileClose(f); //Take action............. break; } } } }