MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / TryCreateDirectory

Function TryCreateDirectory

src/util.cpp:587–599  ·  view source on GitHub ↗

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

585 * write to the parent directory.
586 */
587bool TryCreateDirectory(const boost::filesystem::path& p)
588{
589 try
590 {
591 return boost::filesystem::create_directory(p);
592 } catch (const boost::filesystem::filesystem_error&) {
593 if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p))
594 throw;
595 }
596
597 // create_directory didn't create the directory, it had to have existed already
598 return false;
599}
600
601void FileCommit(FILE *fileout)
602{

Callers 4

CLevelDBWrapperMethod · 0.85
GetDefaultDataDirFunction · 0.85
OpenMethod · 0.85
pickDataDirectoryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected