Languages

Menu
Sites
Language
How can I read/write the PATH.(/data/any.txt)

Hi ss,

 

I create a file /data/any.txt on Z2 mobile and can't read/write it.

but  /opt/usr/media can be access.  does it have any privileges? 

How can I read/write the file(/data/any.txt).

 

 

 

Responses

3 Replies
Mango Bar

You should create file in the data folder of project's root directory instead of real device. The application can read and write its own data files in the application's data directory. You can get absolute path of data directory (/data) using app_get_data_path() api. 

joey wu

Hi Mango,

I know the project's directory can be accessed. 

But  I must read  the file /data/xxx.txt or other PATH on real device directory which is created by driver. I can't certain which PATH should be used.

So can you provide the method of accessing, such as /data/xxx.txt?

 

Thanks,

 

 

Mango Bar

According to the following reference you can access some specific directories of INTERNAL and EXTERNAL storage
https://developer.tizen.org/dev-guide/2.4/org.tizen.gettingstarted/html/native/details/io_overview_n.htm

To know more about getting information about Storages check the following link:
https://developer.tizen.org/ko/development/tutorials/native-application/system/storage?langredirect=1