MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / CreateDirectoriesRecursively

Method CreateDirectoriesRecursively

tests/gtest/gtest-all.cc:9538–9549  ·  view source on GitHub ↗

Create directories so that path exists. Returns true if successful or if the directories already exist; returns false if unable to create directories for any reason.

Source from the content-addressed store, hash-verified

9536// the directories already exist; returns false if unable to create directories
9537// for any reason.
9538bool FilePath::CreateDirectoriesRecursively() const {
9539 if (!this->IsDirectory()) {
9540 return false;
9541 }
9542
9543 if (pathname_.length() == 0 || this->DirectoryExists()) {
9544 return true;
9545 }
9546
9547 const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
9548 return parent.CreateDirectoriesRecursively() && this->CreateFolder();
9549}
9550
9551// Create the directory so that path exists. Returns true if successful or
9552// if the directory already exists; returns false if unable to create the

Callers 1

OpenFileForWritingFunction · 0.80

Calls 5

IsDirectoryMethod · 0.95
DirectoryExistsMethod · 0.95
CreateFolderMethod · 0.95
RemoveFileNameMethod · 0.80

Tested by

no test coverage detected