| 181 | } |
| 182 | |
| 183 | bool DirIsWritable(const fs::path& directory) |
| 184 | { |
| 185 | fs::path tmpFile = directory / fs::unique_path(); |
| 186 | |
| 187 | FILE* file = fsbridge::fopen(tmpFile, "a"); |
| 188 | if (!file) return false; |
| 189 | |
| 190 | fclose(file); |
| 191 | remove(tmpFile); |
| 192 | |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Interpret a string argument as a boolean. |