Skip to main content

write_file

Function write_file 

Source
pub fn write_file<P: AsRef<Path>>(path: P, content: &str) -> Result<()>
Expand description

Writes content to a file, creating parent directories if needed.

§Arguments

  • path - Path to the file.
  • content - Content to write.

§Errors

Returns an error if directory creation or file writing fails.