MCPcopy Create free account
hub / github.com/LUX-Core/lux / TryCreateDirectory

Function TryCreateDirectory

src/util.cpp:678–689  ·  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

676 * write to the parent directory.
677 */
678bool TryCreateDirectory(const boost::filesystem::path& p)
679{
680 try {
681 return boost::filesystem::create_directory(p);
682 } catch (boost::filesystem::filesystem_error& e) {
683 if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p))
684 throw;
685 }
686
687 // create_directory didn't create the directory, it had to have existed already
688 return false;
689}
690
691void FileCommit(FILE* fileout)
692{

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected