MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / createFolder

Function createFolder

src/Engine/CrossPlatform.cpp:460–477  ·  view source on GitHub ↗

* Creates a folder at the specified path. * @note Only creates the last folder on the path. * @param path Full path. * @return Folder created or not. */

Source from the content-addressed store, hash-verified

458 * @return Folder created or not.
459 */
460bool createFolder(const std::string &path)
461{
462#ifdef _WIN32
463 int result = CreateDirectoryA(path.c_str(), 0);
464 if (result == 0)
465 return false;
466 else
467 return true;
468#else
469 mode_t process_mask = umask(0);
470 int result = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
471 umask(process_mask);
472 if (result == 0)
473 return true;
474 else
475 return false;
476#endif
477}
478
479/**
480 * Adds an ending slash to a path if necessary.

Callers 2

setFoldersFunction · 0.85
updateOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected