title: How to write text file on Tizen Gear S2 local file system?
body: <p>I'm developing native app on Samsung Gear S2 which intended to record data from  sensors (accelerometer) on device into local file system.</p>
  <p>I try the directory ( <code>/opt/usr/media/documents/text.txt</code> ) but its not creating the file on device.</p>
  <p>I have enabled the privilege: <a href="http://tizen.org/privilege/mediastorage" rel="nofollow noreferrer">http://tizen.org/privilege/mediastorage</a>.
  Code snippet below:</p>
  <pre><code>static char* write_file(const char* buf)
  {
      FILE *fp;
      fp = fopen(&quot;/opt/usr/media/documents/text.txt&quot;,&quot;w&quot;);
      fputs(buf,fp);
      fclose(fp);
  }
  
  static void btn_write_cb(void *data, Evas_Object *obj, void *event_info)
  {
      appdata_s *ad = data;
      buf=&quot;string to write&quot;;
      write_file(buf);
  }
  </code></pre>
  <p>What is the write way to do? OR Web app work for this task?
  Thanks</p>