Skip to main content

write_owner_only

Function write_owner_only 

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

Creates path with owner-only permissions and writes contents.

Shared with export-key, which has the same requirement. The replacement is atomic: a key file caught half-written is a repository nobody can ever decrypt again, so there must be no moment in which one exists.

ยงErrors

Error::Io when the file cannot be created or written.