Working on Host

This commit is contained in:
ChristianVisintin
2020-11-08 17:56:06 +01:00
parent 34ad55eac5
commit aa963b5000
6 changed files with 281 additions and 9 deletions

View File

@@ -24,12 +24,13 @@
*/
use std::path::PathBuf;
use std::time::Instant;
use std::time::SystemTime;
/// ## FsEntry
///
/// FsEntry represents a generic entry in a directory
#[derive(Clone)]
pub enum FsEntry {
Directory(FsDirectory),
File(FsFile)
@@ -39,11 +40,12 @@ pub enum FsEntry {
///
/// Directory provides an interface to file system directories
#[derive(Clone)]
pub struct FsDirectory {
pub name: PathBuf,
pub last_change_time: Instant,
pub last_access_time: Instant,
pub creation_time: Instant,
pub last_change_time: SystemTime,
pub last_access_time: SystemTime,
pub creation_time: SystemTime,
pub readonly: bool,
pub symlink: Option<PathBuf>, // UNIX only
pub user: Option<String>, // UNIX only
@@ -55,13 +57,14 @@ pub struct FsDirectory {
///
/// FsFile provides an interface to file system files
#[derive(Clone)]
pub struct FsFile {
pub name: PathBuf,
pub last_change_time: Instant,
pub last_access_time: Instant,
pub creation_time: Instant,
pub last_change_time: SystemTime,
pub last_access_time: SystemTime,
pub creation_time: SystemTime,
pub size: usize,
pub ftype: String, // File type
pub ftype: Option<String>, // File type
pub readonly: bool,
pub symlink: Option<PathBuf>, // UNIX only
pub user: Option<String>, // UNIX only