https://bugs.winehq.org/show_bug.cgi?id=51443
Bug ID: 51443 Summary: Test fails in remove_dir_all crate when creating file Product: Wine Version: 6.12 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mikrutrafal@protonmail.com Distribution: ---
Hi, Steps to reproduce on clear wine-devel 6.12 ``` wget https://static.rust-lang.org/dist/rust-1.53.0-x86_64-pc-windows-gnu.msi msiexec /i rust-1.53.0-x86_64-pc-windows-gnu.msi git clone https://github.com/XAMPPRocky/remove_dir_all.git cd remove_dir_all git checkout 9b164cecdb4a0590af68be8b22f9c747402237e3 wine cargo test ```
should print this ``` running 4 tests test removes_read_only ... FAILED test removes_empty ... ok test removes_files ... ok test removes_dirs ... ok
failures:
---- removes_read_only stdout ---- thread 'removes_read_only' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access denied." }', tests\windows.rs:68:49 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures: removes_read_only
test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
error: test failed, to rerun pass '--test windows'
```
I tested it and this works fine in Windows Server 2019
Source code of failed test - https://github.com/XAMPPRocky/remove_dir_all/blob/9b164cecdb4a0590af68be8b22...
``` fn removes_read_only() { env_logger::init(); for i in 0..5 { let path = format!("./readonly/{}/subdir", i);
fs::create_dir_all(&path).unwrap();
let file_path = format!("{}/file.txt", path); { let file = File::create(&file_path).unwrap(); ```