Skip to main content

write_file_0600

Function write_file_0600 

Source
pub fn write_file_0600(path: &Path, contents: &[u8]) -> Result<()>
Expand description

Writes contents to path, owner read/write only (0600) from birth on Unix.

The mode is passed to open(2) at creation, so a fresh file is never group/world-readable even for an instant; a pre-existing looser-perm file is re-tightened via ensure_handle_0600 before the contents land in it (#1132). On non-Unix platforms this is a plain truncating write.