projects
/
platform
/
core
/
dotnet
/
launcher.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring the dotnettool (#231)
[platform/core/dotnet/launcher.git]
/
NativeLauncher
/
util
/
utils.cc
diff --git
a/NativeLauncher/util/utils.cc
b/NativeLauncher/util/utils.cc
index
59a70f3
..
cab3ab2
100644
(file)
--- a/
NativeLauncher/util/utils.cc
+++ b/
NativeLauncher/util/utils.cc
@@
-247,6
+247,18
@@
bool isFileExist(const std::string& path)
return stat(path.c_str(), &sb) == 0;
}
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;
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());
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)
}
std::string getFileName(const std::string& path)