mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Abs path to FsFile and FsDirectory
This commit is contained in:
@@ -43,6 +43,7 @@ pub enum FsEntry {
|
|||||||
#[derive(Clone, std::fmt::Debug)]
|
#[derive(Clone, std::fmt::Debug)]
|
||||||
pub struct FsDirectory {
|
pub struct FsDirectory {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
pub abs_path: PathBuf,
|
||||||
pub last_change_time: SystemTime,
|
pub last_change_time: SystemTime,
|
||||||
pub last_access_time: SystemTime,
|
pub last_access_time: SystemTime,
|
||||||
pub creation_time: SystemTime,
|
pub creation_time: SystemTime,
|
||||||
@@ -60,6 +61,7 @@ pub struct FsDirectory {
|
|||||||
#[derive(Clone, std::fmt::Debug)]
|
#[derive(Clone, std::fmt::Debug)]
|
||||||
pub struct FsFile {
|
pub struct FsFile {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
pub abs_path: PathBuf,
|
||||||
pub last_change_time: SystemTime,
|
pub last_change_time: SystemTime,
|
||||||
pub last_access_time: SystemTime,
|
pub last_access_time: SystemTime,
|
||||||
pub creation_time: SystemTime,
|
pub creation_time: SystemTime,
|
||||||
|
|||||||
@@ -275,6 +275,7 @@ impl Localhost {
|
|||||||
// Is dir
|
// Is dir
|
||||||
FsEntry::Directory(FsDirectory {
|
FsEntry::Directory(FsDirectory {
|
||||||
name: file_name,
|
name: file_name,
|
||||||
|
abs_path: path,
|
||||||
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
@@ -296,6 +297,7 @@ impl Localhost {
|
|||||||
};
|
};
|
||||||
FsEntry::File(FsFile {
|
FsEntry::File(FsFile {
|
||||||
name: file_name,
|
name: file_name,
|
||||||
|
abs_path: path,
|
||||||
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
@@ -339,6 +341,7 @@ impl Localhost {
|
|||||||
// Is dir
|
// Is dir
|
||||||
FsEntry::Directory(FsDirectory {
|
FsEntry::Directory(FsDirectory {
|
||||||
name: file_name,
|
name: file_name,
|
||||||
|
abs_path: path,
|
||||||
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
@@ -357,6 +360,7 @@ impl Localhost {
|
|||||||
};
|
};
|
||||||
FsEntry::File(FsFile {
|
FsEntry::File(FsFile {
|
||||||
name: file_name,
|
name: file_name,
|
||||||
|
abs_path: path,
|
||||||
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_change_time: attr.modified().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
last_access_time: attr.accessed().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
creation_time: attr.created().unwrap_or(SystemTime::UNIX_EPOCH),
|
||||||
|
|||||||
Reference in New Issue
Block a user