GP2X_Coder
Member
Sometimes it will write to a text file sometimes it won't. I don't know why does anyone know of a good input output function that is reliable?
Code:
// Clear the previous log file
std::fstream DebugFile;
// Set the file name
sprintf( FileStr, "%slog.txt", GpeDirectory);
// Open the log and delete the previous written text
DebugFile.open (FileStr, std::ios::out | std::ios::trunc );
// Now write something to the file to test it out
DebugFile << "This is a test."<< "\n";
DebugFile << "To see if it is writing."<< "\n";
// Close the log
DebugFile.close();