Skip to main content

write_atomic

Function write_atomic 

Source
pub fn write_atomic(dest: &Path, bytes: &[u8]) -> Result<()>
Expand description

Atomically write bytes to dest through a Staged file.

Safe when multiple parallel render workers publish the same shared resource (LaTeXML.css, LaTeXML.js, etc.) concurrently: Unix readers never observe a truncated/interleaved file, and Windows avoids ERROR_SHARING_VIOLATION on concurrent writers.