* 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. */
| 1138 | * write to the parent directory. |
| 1139 | */ |
| 1140 | bool TryCreateDirectories(const fs::path& p) |
| 1141 | { |
| 1142 | try |
| 1143 | { |
| 1144 | return fs::create_directories(p); |
| 1145 | } catch (const fs::filesystem_error&) { |
| 1146 | if (!fs::exists(p) || !fs::is_directory(p)) |
| 1147 | throw; |
| 1148 | } |
| 1149 | |
| 1150 | // create_directories didn't create the directory, it had to have existed already |
| 1151 | return false; |
| 1152 | } |
| 1153 | |
| 1154 | bool FileCommit(FILE *file) |
| 1155 | { |
no test coverage detected