Create any directories in the specified path that do not exist.
Synopsis
Declared in <bdls_filesystemutil.h>
static
int
createDirectories(
char const* path,
bool isLeafDirectoryFlag = false);
Description
If the optionally specified isLeafDirectoryFlag is true, treat the final name component in path as a directory name, and create it. Otherwise, create only the directories leading up to the final name component. Return 0 on success, k_ERROR_PATH_NOT_FOUND if a component used as a directory in path exists but is not a directory, and a negative value for any other kind of error. The parameterized STRING_TYPE must be one of bsl::string, std::string, std::pmr::string (if supported), bsl::string_view, or bslstl::StringRef.
Return Value
0 on success, k_ERROR_PATH_NOT_FOUND if a path component exists but is not a directory, and a negative value otherwise
Parameters
Name |
Description |
path |
filesystem path whose missing directories are created |
isLeafDirectoryFlag |
whether to treat the final component as a directory and create it |
Created with MrDocs