언어 설정

Menu
Sites
Language
Can't open file on Emuator

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 by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 댓글
Lakshmi Grandhi
Hi Nick, In SDK 2.1 , only root user has permission for for adding or deleting file, kindly check whether for native have you need to set read and write permissions for filesystem.