MCPcopy Create free account
hub / github.com/ElementsProject/elements / TryCreateDirectories

Function TryCreateDirectories

src/util/system.cpp:1140–1152  ·  view source on GitHub ↗

* Ignores exceptions thrown by create_directories if the requested directory exists. * Specifically handles case where path p exists, but it wasn't possible for the user to * write to the parent directory. */

Source from the content-addressed store, hash-verified

1138 * write to the parent directory.
1139 */
1140bool TryCreateDirectories(const fs::path& p)
1141{
1142 try
1143 {
1144 return fs::create_directories(p);
1145 } catch (const fs::filesystem_error&) {
1146 if (!fs::exists(p) || !fs::is_directory(p))
1147 throw;
1148 }
1149
1150 // create_directories didn't create the directory, it had to have existed already
1151 return false;
1152}
1153
1154bool FileCommit(FILE *file)
1155{

Callers 5

CDBWrapperMethod · 0.85
OpenMethod · 0.85
OpenMethod · 0.85
RestoreWalletFunction · 0.85
showIfNeededMethod · 0.85

Calls 2

create_directoriesFunction · 0.85
existsFunction · 0.85

Tested by

no test coverage detected