| 61 | } |
| 62 | |
| 63 | bool replaceFileWithText(const File& file, const std::string& text) { |
| 64 | std::ofstream stream(file, std::ios::binary); |
| 65 | if (!stream) |
| 66 | return false; |
| 67 | |
| 68 | stream << text; |
| 69 | if (stream.fail()) |
| 70 | return false; |
| 71 | |
| 72 | return true; |
| 73 | } |
| 74 | |
| 75 | bool hasWriteAccess(const File& file) { |
| 76 | std::filesystem::file_status status = std::filesystem::status(file); |
no outgoing calls
no test coverage detected