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

Function TryCreateDirectories

src/util.cpp:1009–1021  ·  view source on GitHub ↗

* Ignores exceptions thrown by Boost's 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

1007 * write to the parent directory.
1008 */
1009bool TryCreateDirectories(const fs::path& p)
1010{
1011 try
1012 {
1013 return fs::create_directories(p);
1014 } catch (const fs::filesystem_error&) {
1015 if (!fs::exists(p) || !fs::is_directory(p))
1016 throw;
1017 }
1018
1019 // create_directories didn't create the directory, it had to have existed already
1020 return false;
1021}
1022
1023bool FileCommit(FILE *file)
1024{

Callers 3

CDBWrapperMethod · 0.85
OpenMethod · 0.85
pickDataDirectoryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected