MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / CreateDirectoriesRecursively

Method CreateDirectoriesRecursively

test/common/gtest/gtest.cpp:8578–8589  ·  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

8576// the directories already exist; returns false if unable to create directories
8577// for any reason.
8578bool FilePath::CreateDirectoriesRecursively() const {
8579 if (!this->IsDirectory()) {
8580 return false;
8581 }
8582
8583 if (pathname_.length() == 0 || this->DirectoryExists()) {
8584 return true;
8585 }
8586
8587 const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
8588 return parent.CreateDirectoriesRecursively() && this->CreateFolder();
8589}
8590
8591// Create the directory so that path exists. Returns true if successful or
8592// if the directory already exists; returns false if unable to create the

Callers 1

OnTestIterationEndMethod · 0.80

Calls 5

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

Tested by

no test coverage detected