From 6a6fa3a3682161fea7e5f829281f4614c2075c09 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Tue, 9 Aug 2022 22:33:12 +0200 Subject: [PATCH] Added fsfat back-end #580 --- dfvfs/helpers/source_scanner.py | 3 ++- dfvfs/path/fat_path_spec.py | 4 ++-- dfvfs/vfs/fat_file_entry.py | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dfvfs/helpers/source_scanner.py b/dfvfs/helpers/source_scanner.py index 24cb9166..ddd9ab90 100644 --- a/dfvfs/helpers/source_scanner.py +++ b/dfvfs/helpers/source_scanner.py @@ -718,7 +718,8 @@ def ScanForFileSystem(self, source_path_spec): 'Unsupported source found more than one file system types.') # TODO: determine root location from file system or path specification. - if type_indicator == definitions.TYPE_INDICATOR_NTFS: + if type_indicator in ( + definitions.TYPE_INDICATOR_FAT, definitions.TYPE_INDICATOR_NTFS): root_location = '\\' else: root_location = '/' diff --git a/dfvfs/path/fat_path_spec.py b/dfvfs/path/fat_path_spec.py index fba77283..ce037101 100644 --- a/dfvfs/path/fat_path_spec.py +++ b/dfvfs/path/fat_path_spec.py @@ -10,7 +10,7 @@ class FATPathSpec(path_spec.PathSpec): """FAT path specification implementation. Attributes: - identifier (int): catalog node identifier (CNID). + identifier (int): (virtual) identifier. location (str): location. """ @@ -23,7 +23,7 @@ def __init__( Note that an FAT path specification must have a parent. Args: - identifier (Optional[int]): catalog node identifier (CNID). + identifier (Optional[int]): (virtual) identifier. location (Optional[str]): location. parent (Optional[PathSpec]): parent path specification. diff --git a/dfvfs/vfs/fat_file_entry.py b/dfvfs/vfs/fat_file_entry.py index 3e735c8a..6916cd9d 100644 --- a/dfvfs/vfs/fat_file_entry.py +++ b/dfvfs/vfs/fat_file_entry.py @@ -116,6 +116,9 @@ def access_time(self): def creation_time(self): """dfdatetime.DateTimeValues: creation time or None if not available.""" timestamp = self._fsfat_file_entry.get_creation_time_as_integer() + if timestamp is None: + return None + return dfdatetime_fat_date_time.FATTimestamp(timestamp=timestamp) @property @@ -127,6 +130,9 @@ def name(self): def modification_time(self): """dfdatetime.DateTimeValues: modification time or None if not available.""" timestamp = self._fsfat_file_entry.get_modification_time_as_integer() + if timestamp is None: + return None + return dfdatetime_fat_date_time.FATTimestamp(timestamp=timestamp) @property