mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Fixed handle_writable_directory on windows
This commit is contained in:
parent
1f50df2af6
commit
6856ce0bf4
1 changed files with 2 additions and 2 deletions
|
@ -535,8 +535,8 @@ fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata
|
|||
fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata) -> bool {
|
||||
use std::os::windows::prelude::MetadataExt;
|
||||
use winapi::um::winnt::FILE_ATTRIBUTE_READONLY;
|
||||
let user_writable = (metadata.file_attributes() & FILE_ATTRIBUTE_READONLY) != 0;
|
||||
if !user_writable {
|
||||
let not_user_writable = (metadata.file_attributes() & FILE_ATTRIBUTE_READONLY) != 0;
|
||||
if not_user_writable {
|
||||
prompt(&(format!("remove write-protected directory {}? ", path.quote())))
|
||||
} else if options.interactive == InteractiveMode::Always {
|
||||
prompt(&(format!("remove directory {}? ", path.quote())))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue