语言

Menu
Sites
Language
[Gear 2] Tizen file system API : fail to write
Hi, I am using file system API which is referenced from API documents : https://developer.tizen.org/documentation/articles/how-access-tizen-file-system?langswitch=en I am using the code by the filesystem API sample code referenced from here : https://developer.tizen.org/dev-guide/2.2.1/org.tizen.web.device.apireference/tizen/filesystem.html#::Filesystem::FileStream (2.2 Code Example) After trying these code It works fine on resolving the directory and create a file. ( I can check my created file on the Gear storage of documents folder) However, I cannot write the string( string : "HelloWorld" ) to the file(test.txt). I have printed filestream.position and the log shows that it is 10, indicating that I should have written "HelloWorld" (10 char) successfully. But It's weird that I cannot see anything change in my file ( stil byte 0 , no text) Here is my code : http://ideone.com/6F9xTb I am new to Tizen wearable programming. I implement my code by modifying sample code of "HelloAccessory" My modification starts from line 131 Thanks for all in advance.

响应

2 回复
Eskan

Do you have this privilege ?

http://tizen.org/privilege/filesystem.write

ChiehHsin Chen

Yes, I add the privilege : http://tizen.org/privilege/filesystem.write and http://tizen.org/privilege/filesystem.read

 

I found a solution but it seems weird.

After I run my program, I cannot see the created file written.

But after I remove my USB connection from Gear2, and reconnect again.

The written file result show up.