:py:mod:`dissect.target.filesystems.ffs` ======================================== .. py:module:: dissect.target.filesystems.ffs Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.filesystems.ffs.FfsFilesystem dissect.target.filesystems.ffs.FfsDirEntry dissect.target.filesystems.ffs.FfsFilesystemEntry .. py:class:: FfsFilesystem(fh: BinaryIO, *args, **kwargs) Bases: :py:obj:`dissect.target.filesystem.Filesystem` Base class for filesystems. .. py:attribute:: __type__ :value: 'ffs' A short string identifying the type of filesystem. .. py:attribute:: ffs .. py:method:: get(path: str) -> dissect.target.filesystem.FilesystemEntry Retrieve a :class:`FilesystemEntry` from the filesystem. :param path: The path which we want to retrieve. :returns: A :class:`FilesystemEntry` for the path. .. py:class:: FfsDirEntry(fs: Filesystem, path: str, name: str, entry: Any) Bases: :py:obj:`dissect.target.filesystem.DirEntry` Directory entry base class. Closely models ``os.DirEntry``. Filesystem implementations are encouraged to subclass this class to provide efficient implementations of the various methods. :param fs: The filesystem the entry belongs to. :param path: The path of the parent directory. :param name: The name of the entry. :param entry: The raw entry backing this directory entry. .. py:attribute:: fs :type: FfsFilesystem The filesystem the entry belongs to. .. py:attribute:: entry :type: dissect.ffs.ffs.INode The raw entry backing this directory entry. .. py:method:: get() -> FfsFilesystemEntry Retrieve the :class:`FilesystemEntry` this directory entry points to. Subclasses should override this method to provide an efficient implementation. .. py:method:: stat(*, follow_symlinks: bool = True) -> dissect.target.helpers.fsutil.stat_result .. py:class:: FfsFilesystemEntry(fs: Filesystem, path: str, entry: Any) Bases: :py:obj:`dissect.target.filesystem.FilesystemEntry` Base class for filesystem entries. .. py:attribute:: fs :type: FfsFilesystem .. py:attribute:: entry :type: dissect.ffs.ffs.INode .. py:method:: get(path: str) -> dissect.target.filesystem.FilesystemEntry Retrieve a :class:`FilesystemEntry` relative to this entry. :param path: The path relative to this filesystem entry. :returns: A relative :class:`FilesystemEntry`. .. py:method:: open() -> BinaryIO Open this filesystem entry. :returns: A file-like object. Resolves symlinks when possible .. py:method:: scandir() -> collections.abc.Iterator[FfsDirEntry] Iterate over the contents of a directory, yields :class:`FilesystemEntry`. :returns: An iterator of :class:`FilesystemEntry`. .. py:method:: is_dir(follow_symlinks: bool = True) -> bool Determine if this entry is a directory. :param follow_symlinks: Whether to resolve the entry if it is a symbolic link. :returns: ``True`` if the entry is a directory or a symbolic link to a directory, return ``False`` otherwise. If ``follow_symlinks`` is ``False``, return ``True`` only if the entry is a directory (without following symlinks). .. py:method:: is_file(follow_symlinks: bool = True) -> bool Determine if this entry is a file. :param follow_symlinks: Whether to resolve the entry if it is a symbolic link. :returns: ``True`` if the entry is a file or a symbolic link to a file, return ``False`` otherwise. If ``follow_symlinks`` is ``False``, return ``True`` only if the entry is a file (without following symlinks). .. py:method:: is_symlink() -> bool Determine whether this entry is a symlink. :returns: ``True`` if the entry is a symbolic link, ``False`` otherwise. .. py:method:: readlink() -> str Read the link where this entry points to, return the resulting path as string. If it is a symlink and returns the entry that corresponds to that path. This means it follows the path a link points to, it tries to do it recursively. :returns: The path the link points to. .. py:method:: stat(follow_symlinks: bool = True) -> dissect.target.helpers.fsutil.stat_result Determine the stat information of this entry. If the entry is a symlink and ``follow_symlinks`` is ``True``, it gets resolved, attempting to stat the path where it points to. :param follow_symlinks: Whether to resolve the symbolic link if this entry is a symbolic link. :returns: The stat information of this entry. .. py:method:: lstat() -> dissect.target.helpers.fsutil.stat_result Determine the stat information of this entry, **without** resolving the symlinks. When it detects a symlink, it will stat the information of the symlink, not the path it points to. :returns: The stat information of this entry.