Skip to content

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

Closed
@alexcrichton

Description

@alexcrichton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-highHigh priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions