copyFile: de-poco-ize and handle EINTR and short writes.

Change-Id: I2046881c786a9f31f45c53f282de9ddd9a9cebcf
This commit is contained in:
Michael Meeks
2020-01-18 15:56:01 +00:00
parent c187f414c5
commit 0599db3576
5 changed files with 82 additions and 19 deletions

View File

@ -80,6 +80,9 @@ namespace FileUtil
removeFile(path.toString(), recursive);
}
/// Copy a file from @fromPath to @toPath, throws on failure.
void copyFileTo(const std::string &fromPath, const std::string &toPath);
/// Make a temp copy of a file, and prepend it with a prefix.
std::string getTempFilePath(const std::string& srcDir, const std::string& srcFilename,
const std::string& dstFilenamePrefix);