i don't even see where you are attempting to open the file, screw GDK built-in file system everyone reports failure and errors with them, either use std::fstream (C++ style) or old C methods:
//C method
FILE* fp = fopen ( "filename.txt", "r" ) //"r" for read, "w" for write, find out more on msdn in the fopen reference
if ( fp == NULL ) //failed
{
//handle failure..
}
//file is open, read it as you like, there are alot of functions to read from a file
//for example:
fgetc ( ... );
fgets ( ... );
fread ( ... );
fclose ( fp ); //done with the file, close it
//now the C++ fstream method
#include <iostream>
#include <fsteam>
using std::ios;
using std::fstream;
//...
//....
fstream file;
file.open ( "filename.txt", ios::in ); //ios::out for writing, ios::in for reading, ios::binary for binary i/o, you can use | for multiple states, for example (ios::in | ios::out) for input/output
if ( !file.is_open ( ) ) //failed
{
//handle error
}
//file is open, read it as you like, there are also alot of methods, check them out on cplusplus.com or anywhere, google is your friend
//for example:
file.read ( ... );
file.getline ( ... );
file.getc ( ... );
file.close ( );
google is your friend, everything's there.