Trait path_permission::unix::PathPermission [−][src]
pub trait PathPermission { fn access(&self, amode: c_int) -> Result<bool>; fn is_readable(&self) -> Result<bool>; fn is_writable(&self) -> Result<bool>; fn is_excutable(&self) -> Result<bool>; fn is_creatable(&self) -> Result<bool>; fn is_removable(&self) -> Result<bool>; fn check_access(&self, mode: u16) -> Result<bool>; fn get_access(&self) -> Result<String>; fn chmod(&self, mode: u16) -> Result<bool>; }
Required methods
fn is_readable(&self) -> Result<bool>
fn is_readable(&self) -> Result<bool>
判断路径是否可读
fn is_writable(&self) -> Result<bool>
fn is_writable(&self) -> Result<bool>
判断路径是否可写
fn is_excutable(&self) -> Result<bool>
fn is_excutable(&self) -> Result<bool>
判断路径是否可执行
fn is_creatable(&self) -> Result<bool>
fn is_creatable(&self) -> Result<bool>
判断路径可否被创建(当前无此路径)
fn is_removable(&self) -> Result<bool>
fn is_removable(&self) -> Result<bool>
判断路径能否被删除
fn check_access(&self, mode: u16) -> Result<bool>
fn check_access(&self, mode: u16) -> Result<bool>
检查文件的权限 mode 可习惯上使用8进制数字,如:0o0644 The file type and mode: The stat.st_mode contains the file type and mode. 帮助手册inode(7)
fn get_access(&self) -> Result<String>
fn get_access(&self) -> Result<String>
返回路径的权限,以 stat 的形式:0o0644 注意:已经格式化为字符串!