You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: std::fs::read_dir returns NotFound for empty volume #120040
This was reported on discord by @Fulgen301 who pointed out that the C++ STL has a similar issue.
Example:
// where `path` is a path to an empty volume.let path = r"\\?\Volume{e6d42597-fcdc-4856-b3c2-482fe652f1df}\";
std::fs::read_dir(path).unwrap();
prints:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
It should return success but the returned iterator will have no items.
Basically if you use FindFirstFileW on a completely empty volume then it will return ERROR_FILE_NOT_FOUND. Rust should interpret this as being an empty iteration and not return an error to the user. Note that empty directories do not return an error so this behaviour was overlooked.
Activity
HTGAzureX1212 commentedon Jan 26, 2024
@rustbot claim
HTGAzureX1212 commentedon Jan 26, 2024
This is fixed in C++ STL after this PR: microsoft/STL#4311
Rollup merge of rust-lang#120373 - HTGAzureX1212:HTGAzureX1212/issue-…
Rollup merge of rust-lang#120373 - HTGAzureX1212:HTGAzureX1212/issue-…
Rollup merge of rust-lang#120373 - HTGAzureX1212:HTGAzureX1212/issue-…
Rollup merge of rust-lang#120373 - HTGAzureX1212:HTGAzureX1212/issue-…
Rollup merge of rust-lang#120373 - HTGAzureX1212:HTGAzureX1212/issue-…
Rollup merge of rust-lang#120373 - HTGAzureX1212:HTGAzureX1212/issue-…
Unrolled build for rust-lang#120373