MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / makeDir

Method makeDir

Utils/FileSystem.h:120–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 static int makeDir(const std::string &path)
121 {
122 std::string npath = normalizePath(path);
123
124 struct stat st;
125 int status = 0;
126
127 if (stat(path.c_str(), &st) != 0)
128 {
129#if WIN32
130 status = _mkdir(path.c_str());
131#else
132 status = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
133#endif
134 if (status != 0 && errno != EEXIST)
135 status = -1;
136 }
137 else if (!(S_IFDIR & st.st_mode))
138 {
139 errno = ENOTDIR;
140 status = -1;
141 }
142
143 return status;
144 }
145
146 /** Make all subdirectories.
147 */

Callers

nothing calls this directly

Calls 2

statClass · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected