Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oakes opened this issue Mar 22, 2015 · 2 comments · Fixed by #23383
Closed

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

oakes opened this issue Mar 22, 2015 · 2 comments · Fixed by #23383

Comments

@oakes
Copy link

oakes commented Mar 22, 2015

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.

@mvdnes
Copy link
Contributor

mvdnes commented Mar 23, 2015

I have found that it also works when using:

use std::fs;

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

@alexcrichton
Copy link
Member

This will be fixed by #23383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants