Refactoring the dotnettool (#231)
[platform/core/dotnet/launcher.git] / NativeLauncher / util / utils.cc
index 59a70f3..cab3ab2 100644 (file)
@@ -247,6 +247,18 @@ bool isFileExist(const std::string& path)
        return stat(path.c_str(), &sb) == 0;
 }
 
+bool isDirectoryExist(const std::string& path)
+{
+       struct stat sb;
+       if (stat(path.c_str(), &sb) != 0) {
+               return false;
+       } else if (sb.st_mode & S_IFDIR) {
+               return true;
+       } else {
+               return false;
+       }
+}
+
 uintptr_t getFileSize(const std::string& path)
 {
        struct stat sb;
@@ -609,7 +621,7 @@ void setCmdName(const std::string& name)
 
        memset(processName, '\0', PRC_NAME_LENGTH);
        snprintf(processName, PRC_NAME_LENGTH, "%s", name.c_str());
-       prctl(PR_SET_NAME, processName);                
+       prctl(PR_SET_NAME, processName);
 }
 
 std::string getFileName(const std::string& path)