Function nannou::io::safe_file_save[][src]

pub fn safe_file_save<P>(path: P, content: &[u8]) -> Result<()> where
    P: AsRef<Path>, 

Saves the file to a temporary file before removing the original to reduce the chance of losing data in the case that something goes wrong during saving.

This function also creates all necessary parent directories if they do not exist.