* @brief Writes the contents of the file to another file. * * @param filePath The file path to write to. * @return true if the file was written successfully, false otherwise. */
| 306 | * @return true if the file was written successfully, false otherwise. |
| 307 | */ |
| 308 | bool writeToFile(const std::string &filePath) |
| 309 | { |
| 310 | KittyIOFile f(filePath, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0666); |
| 311 | return f.open() && writeToFd(f.fd()); |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * @brief Writes the contents of the file to a file descriptor. |