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

检查对路径的权限,通过1(x)、2(w)、4(r)

判断路径是否可读

判断路径是否可写

判断路径是否可执行

判断路径可否被创建(当前无此路径)

判断路径能否被删除

检查文件的权限 mode 可习惯上使用8进制数字,如:0o0644 The file type and mode: The stat.st_mode contains the file type and mode. 帮助手册inode(7)

返回路径的权限,以 stat 的形式:0o0644 注意:已经格式化为字符串!

变更文件的权限 mode 可习惯上使用8进制数字,如:0o0644

Implementations on Foreign Types

Implementors