fs::create_dir_all doesn't work on other computers
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Hi everyone, sorry for my bad english
I have this code:
// Here there is a path generation algorithm, i've excluded it because on the two computers the generated path are the same
//The generated path
let new_file_path = "Z:\NUOVO RAPPORTINO ELETTRONICO\2024\1 Gennaio\Name Surname";
match std::fs::create_dir_all(new_file_path) {
Ok(_r) => {
println!("Creazione cartelle avvenuta con successo!");
//Other things to do if succeeds
},
Err(error) => {
println!("Errore durante la creazione delle cartelle: {error}");
println!("GetLastError: {}", unsafe { GetLastError().to_string() });
},
}
that runs fine on my computer, but throws a runtime error on another.
On the other computer, std::fs::create_dir_all throws this error: failed to create whole tree
and winapi's GetLastError() gives me: ERROR_PATH_NOT_FOUND
The OSs are not the same, mine is Windows 10, the other one is Windows 11, but i don't think that's the problem.
I've compiled it with cargo build --release
Z:\ is a shared network folder on a third computer (Windows 11), but both computer one and two have same permissions
The path Z:\NUOVO RAPPORTINO ELETTRONICO\2024 already exist, on my computer it generates \1 Gennaio\Name Surname in it and then proceed with the other code, on the other one it throws the same errors both if the path "fully" exists (doesn't need to create any folder) or if it needs to create it.
Does anyone have any clue on what's going on?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with std::fs::create_dir_all and compare its behavior on the two Windows systems using the shown Z:\ network path. Check the mapped drive, existing directory, permissions, and GetLastError result in each environment. Done means identifying a reproducible cause or confirming a Rust issue with a minimal reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100