mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 23:47:46 +00:00
Why is S_IWUSR showing up as a u16 on macos
This commit is contained in:
parent
e89d9d091d
commit
21b066a58e
1 changed files with 2 additions and 1 deletions
|
@ -558,7 +558,8 @@ fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
let mode = metadata.permissions().mode();
|
let mode = metadata.permissions().mode();
|
||||||
// Check if directory has user write permissions
|
// Check if directory has user write permissions
|
||||||
let user_writable = (mode & libc::S_IWUSR) != 0;
|
// Why is S_IWUSR showing up as a u16 on macos?
|
||||||
|
let user_writable = (mode & (libc::S_IWUSR as u32)) != 0;
|
||||||
if !user_writable {
|
if !user_writable {
|
||||||
prompt(&(format!("remove write-protected directory {}? ", path.quote())))
|
prompt(&(format!("remove write-protected directory {}? ", path.quote())))
|
||||||
} else if options.interactive == InteractiveMode::Always {
|
} else if options.interactive == InteractiveMode::Always {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue