mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
fixed shred -u for windows
fixed shred panic on windows
This commit is contained in:
parent
ea532d1bdc
commit
7306be6e58
2 changed files with 4 additions and 2 deletions
|
@ -532,7 +532,9 @@ fn wipe_name(orig_path: &Path, verbose: bool) -> Option<PathBuf> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sync every file rename
|
// Sync every file rename
|
||||||
let new_file = File::open(new_path.clone())
|
let new_file = OpenOptions::new()
|
||||||
|
.write(true)
|
||||||
|
.open(new_path.clone())
|
||||||
.expect("Failed to open renamed file for syncing");
|
.expect("Failed to open renamed file for syncing");
|
||||||
new_file.sync_all().expect("Failed to sync renamed file");
|
new_file.sync_all().expect("Failed to sync renamed file");
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ fn test_shred_remove() {
|
||||||
at.touch(file_b);
|
at.touch(file_b);
|
||||||
|
|
||||||
// Shred file_a.
|
// Shred file_a.
|
||||||
scene.ucmd().arg("-u").arg(file_a).run();
|
scene.ucmd().arg("-u").arg(file_a).succeeds();
|
||||||
|
|
||||||
// file_a was deleted, file_b exists.
|
// file_a was deleted, file_b exists.
|
||||||
assert!(!at.file_exists(file_a));
|
assert!(!at.file_exists(file_a));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue