Same as above, but takes a std::filesystem::path instead of filename
Declared in <folly/FileUtil.h>
template<class Container>
requires (std::same_as<std::filesystem::path::value_type, char>)
bool
writeFile(
Container const& data,
std::filesystem::path const& filename,
int flags = O_WRONLY | O_CREAT | O_TRUNC,
mode_t mode = 0666);
True on success, false on failure.
| Name | Description |
|---|---|
| data | The container whose contents are written. |
| filename | Path of the file to write. |
| flags | open() flags controlling how the file is opened. |
| mode | Permission bits used when creating the file. |