File reading/writing

File reading/writing

BY 25 Jul 2014 Native Application Development

Hi,

I need to use file to read from and write in it some data. 

It’s look as:

buf.Construct(BUFFER_SIZE_MAX);

// something push in buf

infoFile.Construct(App::GetInstance()->GetAppDataPath() + L"user_game_info.txt", "w+");

r = infoFile.Write(buf);

// ...

r = infoFile.Seek(FILESEEKPOSITION_BEGIN, 0);

//...

r = infoFile.Read(buf);

//...

App is run successfully only before reading file, trying to read file I got exception with “E_END_OF_FILE”  name and I don’t understand why so repeats again, and again.

Also I want to ask about this created file location on emulator, where it is? Needed to root? How it may be done?

With much regards.

 

Written by