diff --git a/src/fs/mod.rs b/src/fs/mod.rs index c4e8a9c..39fde0b 100644 --- a/src/fs/mod.rs +++ b/src/fs/mod.rs @@ -49,8 +49,8 @@ pub struct FsDirectory { pub creation_time: SystemTime, pub readonly: bool, pub symlink: Option, // UNIX only - pub user: Option, // UNIX only - pub group: Option, // UNIX only + pub user: Option, // UNIX only + pub group: Option, // UNIX only pub unix_pex: Option<(u8, u8, u8)>, // UNIX only } @@ -69,7 +69,7 @@ pub struct FsFile { pub ftype: Option, // File type pub readonly: bool, pub symlink: Option, // UNIX only - pub user: Option, // UNIX only - pub group: Option, // UNIX only + pub user: Option, // UNIX only + pub group: Option, // UNIX only pub unix_pex: Option<(u8, u8, u8)>, // UNIX only } diff --git a/src/host/mod.rs b/src/host/mod.rs index 6adf23e..fcfc453 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -32,7 +32,7 @@ extern crate users; #[cfg(any(unix, macos, linux))] use std::os::unix::fs::MetadataExt; #[cfg(any(unix, macos, linux))] -use users::{get_group_by_gid, get_user_by_uid}; +// use users::{get_group_by_gid, get_user_by_uid}; // Locals use crate::fs::{FsDirectory, FsEntry, FsFile}; @@ -259,6 +259,7 @@ impl Localhost { let path: PathBuf = entry.path(); let attr: Metadata = fs::metadata(path.clone()).unwrap(); // Get user stuff + /* let user: Option = match get_user_by_uid(attr.uid()) { Some(user) => Some(String::from(user.name().to_str().unwrap_or(""))), None => None, @@ -267,6 +268,7 @@ impl Localhost { Some(group) => Some(String::from(group.name().to_str().unwrap_or(""))), None => None, }; + */ let file_name: String = String::from(path.file_name().unwrap().to_str().unwrap_or("")); // Match dir / file @@ -284,8 +286,8 @@ impl Localhost { Ok(p) => Some(p), Err(_) => None, }, - user: user, - group: group, + user: Some(attr.uid()), + group: Some(attr.gid()), unix_pex: Some(self.u32_to_mode(attr.mode())), }) } @@ -308,8 +310,8 @@ impl Localhost { Ok(p) => Some(p), Err(_) => None, }, - user: user, - group: group, + user: Some(attr.uid()), + group: Some(attr.gid()), unix_pex: Some(self.u32_to_mode(attr.mode())), }) }