Modify AppInfo API for sdcard
[platform/framework/native/appfw.git] / src / app / FApp_AppInfo.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 8cec93c..e74a86b
@@ -177,6 +177,14 @@ _AppInfo::Construct(void)
                pFile = fdopen(fd, "r");
                SysTryCatch(NID_APP, pFile != NULL, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Opening appinfo file (%s) failed : %s.", appInfoPath, strerror(errno));
 
+               // sdcard
+               char sdInfoPath[PATH_MAX] = {0, };
+               strncpy(sdInfoPath, "/opt/storage/sdcard/app2sd/", strlen("/opt/storage/sdcard/app2sd/"));
+               strncat(sdInfoPath, pPackageId, MAX_APPID);
+
+               int sdFd = open(sdInfoPath, O_RDONLY);
+               SysLog(NID_APP, "sd root directory (%s:%d) open.", sdInfoPath, sdFd);
+
                char apiVersion[MAX_APIVERSION] = {0, };
                char* pRet = fgets(apiVersion, MAX_APIVERSION - 1, pFile);
                SysTryCatch(NID_APP, pRet != NULL, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Reading appinfo file (%s) failed : %s.", appInfoPath, strerror(errno));