Skip to content
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

fs::create_dir_all fails for directory junctions on Windows #26716

Closed
alexcrichton opened this Issue Jul 1, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@alexcrichton
Copy link
Member

alexcrichton commented Jul 1, 2015

First reported in rust-lang/cargo#1749, it looks like if an intermediate directory is a junction on Windows then fs::create_dir_all will fail. Unfortunately the standard library doesn't provide away to create a junction, but a setup like this should work:

mkdir foo
mklink /J bar foo
use std::fs;
fs::create_dir_all("bar/test").unwrap() // this fails
@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jul 1, 2015

The Cargo report claims this was a regression, so I'm going to nominate this.

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jul 1, 2015

I suspect fs::metadata(&junction).is_dir() is returning false (when it should perhaps return true), but I have not had a chance to investigate this too closely.

@alexcrichton alexcrichton added the T-libs label Jul 1, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jul 8, 2015

triage: P-high

@rust-highfive rust-highfive added P-high and removed I-nominated labels Jul 8, 2015

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 9, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jul 10, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716

bors added a commit that referenced this issue Jul 10, 2015

Auto merge of #26929 - alexcrichton:windows-dir-junction, r=brson
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes #26716

bors added a commit that referenced this issue Jul 11, 2015

Auto merge of #26929 - alexcrichton:windows-dir-junction, r=brson
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes #26716

@bors bors closed this in #26929 Jul 11, 2015

jroesch added a commit to jroesch/rust that referenced this issue Jul 21, 2015

std: Consider directory junctions as directories
Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes rust-lang#26716
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.