dissect.target.filesystems.tar
#
Module Contents#
Classes#
Filesystem implementation for tar files. |
|
Virtual file backed by a file-like object. |
|
Virtual directory implementation. Backed by a dict. |
Attributes#
- dissect.target.filesystems.tar.log#
- class dissect.target.filesystems.tar.TarFilesystem(fh: BinaryIO, base: str | None = None, tarinfo: tarfile.TarInfo | None = None, *args, **kwargs)#
Bases:
dissect.target.filesystem.Filesystem
Filesystem implementation for tar files.
- __fstype__ = 'tar'#
- get(path: str, relentry: dissect.target.filesystem.FilesystemEntry | None = None) dissect.target.filesystem.FilesystemEntry #
Returns a TarFilesystemEntry object corresponding to the given path.
- class dissect.target.filesystems.tar.TarFilesystemEntry(fs: Filesystem, path: str, entry: Any)#
Bases:
dissect.target.filesystem.VirtualFile
Virtual file backed by a file-like object.
- open() BinaryIO #
Returns file handle (file-like object).
- iterdir() Iterator[str] #
Iterate over the contents of a directory, return them as strings.
- Returns:
An iterator of directory entries as path strings.
- scandir() Iterator[dissect.target.filesystem.FilesystemEntry] #
Iterate over the contents of a directory, return them as FilesystemEntry’s.
- Returns:
An iterator of directory entries as FilesystemEntry’s.
- is_dir(follow_symlinks: bool = True) bool #
Return whether this entry is a directory.
- is_file(follow_symlinks: bool = True) bool #
Return whether this entry is a file.
- is_symlink() bool #
Return whether this entry is a link.
- readlink() str #
Read the link if this entry is a symlink. Returns a string.
- readlink_ext() dissect.target.filesystem.FilesystemEntry #
Read the link if this entry is a symlink. Returns a filesystem entry.
- stat(follow_symlinks: bool = True) dissect.target.helpers.fsutil.stat_result #
Return the stat information of this entry.
- lstat() dissect.target.helpers.fsutil.stat_result #
Return the stat information of the given path, without resolving links.
- class dissect.target.filesystems.tar.TarFilesystemDirectoryEntry(fs: TarFilesystem, path: str, entry: tarfile.TarInfo)#
Bases:
dissect.target.filesystem.VirtualDirectory
Virtual directory implementation. Backed by a dict.
- stat(follow_symlinks: bool = True) dissect.target.helpers.fsutil.stat_result #
Return the stat information of this entry.
- lstat() dissect.target.helpers.fsutil.stat_result #
Return the stat information of the given path, without resolving links.