Skip to content

Commit

Permalink
Changed list file entries to provide full OS path
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Feb 11, 2024
1 parent b3d081f commit 9d5ffb0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions dfimagetools/file_entry_lister.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 9d5ffb0

Please sign in to comment.