-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flags to print ACLs and file flags #170
Comments
Hi, I have found out a snippet to print the file flags, which calls strtofflags(3). Here is the example: use std::fs;
use std::os::macos::fs::MetadataExt;
use std::os::raw::c_char;
#[cfg(target_os = "macos")]
extern "C" {
fn fflagstostr(flags: u32) -> *const c_char;
}
fn main() -> std::io::Result<()> {
let attr = fs::metadata("/Users/hguandl/Library")?;
let flag_str = unsafe {
let c_buf = fflagstostr(attr.st_flags());
CStr::from_ptr(c_buf)
};
println!("{}", flag_str.to_str().unwrap());
Ok(())
} $ cargo run
hidden |
Would it make sense to split off a separate feature request asking for a Example with acls
Example without acls
|
On Linux
|
In the meantime, the
Though it would be nice to indicate ACLs with the plus sign, just as |
macOS's
ls
has-e
to print ACLs and-O
to print file flags (e.g.hidden
). It would be great ifexa
could offer the same flags, at least on macOS.The text was updated successfully, but these errors were encountered: