Skip to main content

write_whole

Function write_whole 

Source
pub fn write_whole(
    target: impl Into<OutputTarget>,
    write: impl FnOnce(&mut File) -> Result<(), String>,
) -> Result<(), EncodeError>
Expand description

Writes a whole file at target, published only once write has written all of it: write fills the claimed partial file beside it (the same claim and lock a video output takes), which is synced and renamed into place as [publish] does. Any failure removes the partial and leaves what was at the target’s path. What is there is looked at before anything is written, and again at the rename, as it may have changed meanwhile.

§Errors

When the target refuses what is at its path, its partial is held by a live export (PARTIAL_OUTPUT_IN_USE), write fails, or the file system refuses.