From 9d5ffb07bf847136ee2324f81cdc396e47f4682e Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 11 Feb 2024 09:25:51 +0100 Subject: [PATCH] Changed list file entries to provide full OS path --- dfimagetools/file_entry_lister.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dfimagetools/file_entry_lister.py b/dfimagetools/file_entry_lister.py index b561327..4ffc168 100644 --- a/dfimagetools/file_entry_lister.py +++ b/dfimagetools/file_entry_lister.py @@ -159,7 +159,13 @@ def ListFileEntries(self, base_path_specs): path_specification_string])) return - base_path_segments = self._GetBasePathSegments(base_path_spec.parent) + if base_path_spec.type_indicator != dfvfs_definitions.TYPE_INDICATOR_OS: + base_path_segments = self._GetBasePathSegments(base_path_spec.parent) + else: + base_path_segments = file_system.SplitPath(base_path_spec.location) + base_path_segments.insert(0, '') + base_path_segments.pop() + for result in self._ListFileEntry( file_system, file_entry, base_path_segments): yield result @@ -185,7 +191,12 @@ def ListFileEntriesWithFindSpecs(self, base_path_specs, find_specs): else: mount_point = base_path_spec.parent - base_path_segments = self._GetBasePathSegments(base_path_spec.parent) + if base_path_spec.type_indicator != dfvfs_definitions.TYPE_INDICATOR_OS: + base_path_segments = self._GetBasePathSegments(base_path_spec.parent) + else: + base_path_segments = file_system.SplitPath(base_path_spec.location) + base_path_segments.insert(0, '') + base_path_segments.pop() searcher = file_system_searcher.FileSystemSearcher( file_system, mount_point)