Can’t open file on Emuator
By Nikolay Cholakov
07 Jun 2013 05:35
English
1 Replies
Hi,
I have issue with constructing file object. The Construct result is E_INVALID_ARG even for read only purpose. But file exists and contains in data fodlder.
This issue comes from SDK 2.1 in SDK 2.0 it were work fine.
Step to reproduce:
1. Star new native project with scene manager
2. When button clicked set code to create file
There code example:
String LoadFileToString(const String& filePath)
{
String buffer;
String str;
bool b = File::IsFileExist(filePath); //b is true
// Create a StringTokenizer instance
File* file = new File;
// Create file
result r = file->Construct(filePath, "r"); //Try to open it, file encoding - UTF8
AppLog("%s", GetErrorMessage(r)); //E_INVALID_ARG
// Write to the file
if (r == E_SUCCESS)
{
while (file->Read(str) == E_SUCCESS)
{
AppLog("=%S", str.GetPointer());
buffer.Append(str);
}
}
delete file;
return buffer;
}
Any advice would be appreciable.
THanks,
Nick
Edited on 18 03, 2014
You must log in to use this service. Log in now?
The tag you entered already exists.
Do you want to report this post as spam?
The post has been reported as spam.
cannot be empty.
Are you sure you want to cancel and return to the list?
The code has been copied to the clipboard.
Enter a title.