some small refactoring
This commit is contained in:
@@ -55,19 +55,17 @@ bool is_path_file(const std::string &path) {
|
||||
}
|
||||
|
||||
bool is_path_dir(const std::string &path) {
|
||||
struct stat buf;
|
||||
struct stat buf{};
|
||||
stat(path.c_str(), &buf);
|
||||
return (bool) S_ISDIR(buf.st_mode);
|
||||
}
|
||||
|
||||
int mk_path_dir(const std::string &path) {
|
||||
int r = ::mkdir(path.c_str(), 0755);
|
||||
return r;
|
||||
return ::mkdir(path.c_str(), 0755);
|
||||
}
|
||||
|
||||
int rm_path_dir(const std::string &path) {
|
||||
int r = ::rmdir(path.c_str());
|
||||
return r;
|
||||
return ::rmdir(path.c_str());
|
||||
}
|
||||
|
||||
MlValue exec_system_cmd(const std::string &cmd) {
|
||||
|
||||
Reference in New Issue
Block a user