| 401 | } |
| 402 | |
| 403 | bool WriteFile(string_view filename, bool binary, string_view contents, bool allow_absolute) { |
| 404 | FILE *f = OpenForWriting(filename, binary, allow_absolute); |
| 405 | size_t written = 0; |
| 406 | if (f) { |
| 407 | written = fwrite(contents.data(), contents.size(), 1, f); |
| 408 | fclose(f); |
| 409 | } |
| 410 | return written == 1; |
| 411 | } |
| 412 | |
| 413 | bool RenameFile(string_view oldfilename, string_view newfilename) { |
| 414 | int result = rename(SanitizePath(oldfilename).c_str(), SanitizePath(newfilename).c_str()); |
no test coverage detected