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.
| 722 | // Specifically handles case where path p exists, but it wasn't possible for the user to write to |
| 723 | // the parent directory. |
| 724 | bool TryCreateDirectory(const boost::filesystem::path& p) { |
| 725 | try { |
| 726 | return boost::filesystem::create_directory(p); |
| 727 | } catch (const boost::filesystem::filesystem_error&) { |
| 728 | if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p)) throw; |
| 729 | } |
| 730 | |
| 731 | // create_directory didn't create the directory, it had to have existed already |
| 732 | return false; |
| 733 | } |
| 734 | |
| 735 | void FileCommit(FILE* fileout) { |
| 736 | fflush(fileout); // harmless if redundantly called |
no outgoing calls
no test coverage detected