Skip to content

fs::create_dir_all fails if root dir does not exist #23624

Closed
@oakes

Description

@oakes

The following panics:

use std::fs;

fn main() {
    fs::create_dir_all("a/b/c").unwrap();
}

The following works:

use std::fs;

fn main() {
    fs::create_dir("a").unwrap();
    fs::create_dir_all("a/b/c").unwrap();
}

Apologies in advance if this is intended behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions