MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TryCreateDirectories

Function TryCreateDirectories

src/util/fs_helpers.cpp:274–285  ·  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

272 * write to the parent directory.
273 */
274bool TryCreateDirectories(const fs::path& p)
275{
276 try {
277 return fs::create_directories(p);
278 } catch (const fs::filesystem_error&) {
279 if (!fs::exists(p) || !fs::is_directory(p))
280 throw;
281 }
282
283 // create_directories didn't create the directory, it had to have existed already
284 return false;
285}
286
287std::string PermsToSymbolicString(fs::perms p)
288{

Callers 5

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

Calls 1

existsFunction · 0.85

Tested by 1

BasicTestingSetupMethod · 0.68