Struct openat_ext::FileWriter [−][src]
pub struct FileWriter<'a> {
pub writer: BufWriter<File>,
pub tmp_prefix: String,
pub tmp_suffix: String,
// some fields omitted
}Expand description
A wrapper for atomically replacing a file. The primary field
to access here is the writer. You can also configure the
temporary prefix and suffix used for the temporary file before
it is moved over the final destination.
Call complete() to rename() the file into place.
Fields
writer: BufWriter<File>Write to the destination file.
tmp_prefix: StringThis string will be used as a prefix for the temporary file
tmp_suffix: StringThis string will be used as a suffix for the temporary file
Implementations
Flush any outstanding buffered data and rename the temporary
file into place. The provided closure will be invoked
on the real underlying file descriptor before it is
renamed into place. You can use this to change file attributes.
For example, you can change the mode, extended attributes, or invoke
fchmod() to change ownership, etc.
Auto Trait Implementations
impl<'a> RefUnwindSafe for FileWriter<'a>impl<'a> Send for FileWriter<'a>impl<'a> Sync for FileWriter<'a>impl<'a> Unpin for FileWriter<'a>impl<'a> UnwindSafe for FileWriter<'a>