Hi, I try to read folders from /opt/usr/media on Gear Fit 2 from service app. It is hybrid app. Web App starts service and then
I need to read all folders from media folder (like documents, downloads and any folder there).
The code stops at getting folder attributes - line: if(stat(path,$st) == -1).
I don't know what is wrong. The code read files without problem when it is inside UI app but
doesn't want to work in hybrid service. Are there any constraints about readig files from service app on Gear Fit 2?
I added privilages to tizen-manifes.xml.
<privilege>http://tizen.org/privilege/mediastorage</privilege>
<privilege>http://tizen.org/privilege/externalstorage</privilege>
char *path;
storage_get_root_directory(STORAGE_TYPE_INTERNAL, &path); // works OK
// path contains now: /opt/usr/media
struct stat st;
if (stat(path, &st) == -1) { // STOP HERE, stat() returns -1
return; // code enter here and ending
}
if (S_ISDIR(st.st_mode)) {
... // not enter here
}
...