pub struct File { /* private fields */ }Expand description
Describes a file entry on the remote system. This data type is returned in a collection after parsing a LIST output
Implementations§
source§impl File
impl File
sourcepub fn is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
Get whether file is a directory
sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Get whether file is a symlink
sourcepub fn symlink(&self) -> Option<&Path>
pub fn symlink(&self) -> Option<&Path>
Returns, if available, the file the symlink is pointing to
pub fn modified(&self) -> SystemTime
sourcepub fn uid(&self) -> Option<u32>
pub fn uid(&self) -> Option<u32>
Returns when available the owner user of the file. (POSIX only)
sourcepub fn gid(&self) -> Option<u32>
pub fn gid(&self) -> Option<u32>
Returns when available the owner group of the file. (POSIX only)
sourcepub fn can_read(&self, who: PosixPexQuery) -> bool
pub fn can_read(&self, who: PosixPexQuery) -> bool
Returns whether who can read file
sourcepub fn can_write(&self, who: PosixPexQuery) -> bool
pub fn can_write(&self, who: PosixPexQuery) -> bool
Returns whether who can write file
sourcepub fn can_execute(&self, who: PosixPexQuery) -> bool
pub fn can_execute(&self, who: PosixPexQuery) -> bool
Returns whether who can execute file
sourcepub fn from_mlsx_line(line: &str) -> Result<Self, ParseError>
pub fn from_mlsx_line(line: &str) -> Result<Self, ParseError>
Parse an output line from a MLSD or MLST command
sourcepub fn from_posix_line(line: &str) -> Result<Self, ParseError>
pub fn from_posix_line(line: &str) -> Result<Self, ParseError>
Parse a POSIX LIST output line and if it is valid, return a File instance.
In case of error a ParseError is returned
sourcepub fn from_dos_line(line: &str) -> Result<Self, ParseError>
pub fn from_dos_line(line: &str) -> Result<Self, ParseError>
Try to parse a “LIST” output command line in DOS format. Returns error if syntax is not DOS compliant. DOS syntax has the following syntax:
{DATE} {TIME} {<DIR> | SIZE} {FILENAME}
10-19-20 03:19PM <DIR> pub
04-08-14 03:09PM 403 readme.txt