Skip to main content

Module output_file

Module output_file 

Source
Expand description

A file written whole or not at all. OutputFile writes a private temp file beside the destination and moves it into place in OutputFile::commit; until then a failure leaves the old file (bytes and permissions) untouched and a new export leaves nothing; dropping uncommitted (even in a panic) removes the temp file. The file is synced before the rename (some errors surface only then); the rename is not, so a power cut right after can lose it. Every user-facing file goes through here: exports, the Data Quality report, chart images.

Structs§

OutputFile
A file being written to a temporary sibling of its destination.

Enums§

Overwrite
What the commit may do to a file already at the destination.
Refused
Why OutputFile would not write a destination. Carried inside the io::Error, whose kind says the same to code that matches on kinds; its text is for the user and leaves the path to the caller.