MCPcopy Create free account
hub / github.com/BlueMatthew/WechatExporter / makePathImpl

Function makePathImpl

WechatExporter/core/FileSystem.cpp:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72#ifndef _WIN32
73int makePathImpl(const std::string::value_type *path, mode_t mode)
74{
75 struct stat st;
76 int status = 0;
77
78 if (stat(path, &st) != 0)
79 {
80 // Directory does not exist. EEXIST for race condition
81 if (mkdir(path, mode) != 0 && errno != EEXIST)
82 status = -1;
83 }
84 else if (!S_ISDIR(st.st_mode))
85 {
86 // errno = ENOTDIR;
87 status = -1;
88 }
89
90 return status;
91}
92#endif
93
94bool makeDirectory(const std::string& path)

Callers 1

makeDirectoryFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected