Skip to main content

write_file_new

Function write_file_new 

Source
pub fn write_file_new(
    path: &Path,
    frontmatter: &Frontmatter,
    body: &str,
) -> Result<(), ParseError>
Expand description

Atomically create a markdown file from frontmatter + body, refusing with std::io::ErrorKind::AlreadyExists if the destination already exists.

This is the create-new sibling of write_file: same canonical rendering and durable temp-file path, but backed by crate::fsx::write_atomic_new so two concurrent creators for the same path cannot both succeed.