Skip to content

Commit

Permalink
Added fsfat back-end log2timeline#580
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Aug 9, 2022
1 parent 0ca9d32 commit 6a6fa3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dfvfs/helpers/source_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '/'
Expand Down
4 changes: 2 additions & 2 deletions dfvfs/path/fat_path_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand All @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions dfvfs/vfs/fat_file_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6a6fa3a

Please sign in to comment.