file-owner

Crates.iofile-owner
lib.rsfile-owner
version0.1.2
sourcesrc
created_at2021-03-15 15:44:10.19662
updated_at2023-09-04 19:23:46.983305
descriptionSet and get Unix file owner and group
homepagehttps://sr.ht/~jpastuszek/file-owner/
repositoryhttps://git.sr.ht/~jpastuszek/file-owner
max_upload_size
id369265
size16,406
Jakub Pastuszek (jpastuszek)

documentation

https://docs.rs/file-owner

README

Latest Version Documentation License

Set and get Unix file owner and group.

UID/GUI numbers or user/group names can be used.

Note: This crate will only compile on Unix systems.

use file_owner::PathExt;

"/tmp/baz".set_owner("nobody").unwrap();
"/tmp/baz".set_group("nogroup").unwrap();

let o = "/tmp/baz".owner().unwrap();
o.id(); // 99
o.name(); // Some("nobody")

let g = "/tmp/baz".group().unwrap();
g.id(); // 99
g.name(); // Some("nogroup")

See module level documentation on docs.rs for more examples.

Commit count: 0

cargo fmt