Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions freezetag/freezefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ def open(self, path, flags):
if not frozen_entry:
raise FuseOSError(ENOENT)

# This is the path, relative to the freezetag file's root, that we are trying to open.
# Knowing this is essential to providing the correct metadata.
#
# TODO: validate that this is correct on all operating systems.
target_path = "/".join(frozen_entry.path.parts[2:])

freezetag_path = None
metadata = None
if frozen_entry.metadata_len:
Expand All @@ -383,8 +389,11 @@ def open(self, path, flags):

for f in freezetag.data.frozen.files:
if f.checksum == item.checksum:
metadata = f.metadata
break
if f.path == target_path:
self._log_verbose(f'opened {f.path} as {path} (target: {target_path})')
metadata = f.metadata
break
self._log_verbose(f'ignoring {f.path} despite matching checksum (target: {target_path})')

file = FuseFile.from_info(file_entry.path, flags, metadata, file_entry.metadata_info, file_entry.metadata_len,
frozen_entry.metadata_len)
Expand Down