dissect.target.filesystems.ad1¶
Module Contents¶
Classes¶
Base class for filesystems. |
|
Base class for filesystem entries. |
- class dissect.target.filesystems.ad1.AD1Filesystem(fh: BinaryIO, *args, **kwargs)¶
Bases:
dissect.target.filesystem.FilesystemBase class for filesystems.
- __type__ = 'ad1'¶
A short string identifying the type of filesystem.
- ad1¶
- get(path: str) AD1FilesystemEntry¶
Retrieve a
FilesystemEntryfrom the filesystem.- Parameters:
path – The path which we want to retrieve.
- Returns:
A
FilesystemEntryfor the path.
- class dissect.target.filesystems.ad1.AD1FilesystemEntry(fs: Filesystem, path: str, entry: Any)¶
Bases:
dissect.target.filesystem.FilesystemEntryBase class for filesystem entries.
- get(path: str) AD1FilesystemEntry¶
Retrieve a
FilesystemEntryrelative to this entry.- Parameters:
path – The path relative to this filesystem entry.
- Returns:
A relative
FilesystemEntry.
- open() BinaryIO¶
Open this filesystem entry.
- Returns:
A file-like object. Resolves symlinks when possible
- iterdir() collections.abc.Iterator[str]¶
Iterate over the contents of a directory, return them as strings.
- Returns:
An iterator of directory entries as path strings.
- scandir() collections.abc.Iterator[AD1FilesystemEntry]¶
Iterate over the contents of a directory, yields
FilesystemEntry.- Returns:
An iterator of
FilesystemEntry.
- is_file(follow_symlinks: bool = True) bool¶
Determine if this entry is a file.
- Parameters:
follow_symlinks – Whether to resolve the entry if it is a symbolic link.
- Returns:
Trueif the entry is a file or a symbolic link to a file, returnFalseotherwise. Iffollow_symlinksisFalse, returnTrueonly if the entry is a file (without following symlinks).
- is_dir(follow_symlinks: bool = True) bool¶
Determine if this entry is a directory.
- Parameters:
follow_symlinks – Whether to resolve the entry if it is a symbolic link.
- Returns:
Trueif the entry is a directory or a symbolic link to a directory, returnFalseotherwise. Iffollow_symlinksisFalse, returnTrueonly if the entry is a directory (without following symlinks).
- is_symlink() bool¶
Determine whether this entry is a symlink.
- Returns:
Trueif the entry is a symbolic link,Falseotherwise.
- 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.
- readlink_ext() dissect.target.filesystem.FilesystemEntry¶
Read the link where this entry points to, return the resulting path as
FilesystemEntry.If it is a symlink and returns the string that corresponds to that path. This means it follows the path a link points to, it tries to do it recursively.
- Returns:
The filesystem entry the link points to.
- 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_symlinksisTrue, it gets resolved, attempting to stat the path where it points to.- Parameters:
follow_symlinks – Whether to resolve the symbolic link if this entry is a symbolic link.
- Returns:
The stat information of this entry.
- 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.