Hi Doug Turner,

I am developing an API that operates files and directories on SD card using nsIFile. All the reading features work fine. When I try to write to SD Card like renaming or copying a file, I got a NS_ERROR_FILE_ACCESS_DENIED error from nsIFile.

1.
I find out that permission of /sdcard is "---rwxr-x system sdcard_rw", which indicates that users who are not in sdcard_rw group don't have permisson to write. I also notice that the owner of each app process is app_<pid>.

Q: Is there some way to add the owner of an app process to sdcard_rw group?

2.
I tried to add device-storage:sdcard permisson in the manifest.webapp of my test app. It doesn't work.

Q: Is device-storage:sdcard only for Device Storage API?

3.
I see DeviceStorage API uses IPC and perform file operations in the parent process.

Q: Is this the supposed / standard way for an API to gain write permission of SD card? If not, then what is?

Thank you!

--

Best regards,
尤睿(Ray You)

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to