diff --git a/src/sparsezoo/objects/directory.py b/src/sparsezoo/objects/directory.py index fe98778c..86c1e72f 100644 --- a/src/sparsezoo/objects/directory.py +++ b/src/sparsezoo/objects/directory.py @@ -212,7 +212,7 @@ def get_file(self, file_name: str) -> Optional[File]: for file in self.files: if file is None: continue - if file.name == file_name: + if file.name == os.path.basename(file_name): return file if isinstance(file, Directory): file = file.get_file(file_name=file_name)