dissect.target.helpers.mount#

Module Contents#

Classes#

DissectMount

This class should be subclassed and passed as an argument to FUSE on

Attributes#

dissect.target.helpers.mount.log#
dissect.target.helpers.mount.CACHE_SIZE#
class dissect.target.helpers.mount.DissectMount(fs: dissect.target.filesystem.Filesystem)#

Bases: fuse.Operations

This class should be subclassed and passed as an argument to FUSE on initialization. All operations should raise a FuseOSError exception on error.

When in doubt of what an operation should do, check the FUSE header file or the corresponding system call man page.

getxattr#
listxattr#
getattr(path: str, fh: int | None = None) dict#

Returns a dictionary with keys identical to the stat C structure of stat(2).

st_atime, st_mtime and st_ctime should be floats.

NOTE: There is an incompatibility between Linux and Mac OS X concerning st_nlink of directories. Mac OS X counts all files inside the directory, while Linux counts only the subdirectories.

open(path: str, flags: int) int#

When raw_fi is False (default case), open should return a numerical file handle.

When raw_fi is True the signature of open becomes:

open(self, path, fi)

and the file handle should be set directly.

opendir(path: str) int#

Returns a numerical file handle.

read(path: str, size: int, offset: int, fh: int)#

Returns a string containing the data requested.

readdir(path: str, fh: int)#

Can return either a list of names, or a list of (name, attrs, offset) tuples. attrs is a dict as in getattr.

release(path: str, fh: int) int#
releasedir(path: str, fh: int) int#