From: Taeyoung Kim Date: Thu, 28 Apr 2016 06:57:17 +0000 (+0900) Subject: external: add function to get specific directories X-Git-Tag: submit/tizen/20160510.075001~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eebcfd39a817a7e2cb89ae2a1deb9f7beedd414b;p=platform%2Fcore%2Fsystem%2Flibstorage.git external: add function to get specific directories - The specific directories are under the root path of external storage. - Ringtone path is not supported on external storages. Change-Id: Ie7e13d19a30dbe8e6b874eba98f498c81c5da0a0 Signed-off-by: Taeyoung Kim --- diff --git a/src/storage.c b/src/storage.c index 7f56f52..41a3b3b 100644 --- a/src/storage.c +++ b/src/storage.c @@ -167,7 +167,18 @@ API int storage_get_directory(int storage_id, storage_directory_e type, char **p } /* external storage */ - return STORAGE_ERROR_NONE; + if (type == STORAGE_DIRECTORY_SYSTEM_RINGTONES) { + _E("Not support directory : id(%d) type(%d)", storage_id, type); + return STORAGE_ERROR_NOT_SUPPORTED; + } + + ret = storage_ext_get_root(storage_id, root, sizeof(root)); + if (ret < 0) { + _E("Failed to get root dir for external storage(id:%d, ret:%d)", storage_id, ret); + return STORAGE_ERROR_OPERATION_FAILED; + } + + snprintf(temp, sizeof(temp), "%s/%s", root, dir_path[type]); out: *path = strdup(temp);