fox-it / dissect.target

The Dissect module tying all other Dissect modules together. It provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets).
GNU Affero General Public License v3.0
37 stars 41 forks source link

Separate lookup of directory entries in `DirectoryFilesystem.get` into another method. #708

Open Schamper opened 1 month ago

Schamper commented 1 month ago

Currently all the logic is in get() but there are some cases where you may want to subtly tweak how filesystem entries are mapped. The logic should be separated out into another method(s) so that subclasses may customize the behaviour.

Zawadidone commented 1 month ago

How should this be implemented? I expect that file entries are already mapped when the filesystem is initialized.

Schamper commented 1 month ago

The DirectoryFilesystem doesn't do any mapping, so any customization in lookup can be done dynamically at lookup time: https://github.com/fox-it/dissect.target/blob/94cd431d0c33a3f940670f510683486b9538498d/dissect/target/filesystems/dir.py#L30-L55