dissect.target.filesystems.tar#

Module Contents#

Classes#

TarFilesystem

Filesystem implementation for tar files.

TarFilesystemEntry

Virtual file backed by a file-like object.

TarFilesystemDirectoryEntry

Virtual directory implementation. Backed by a dict.

Attributes#

log

dissect.target.filesystems.tar.log#
class dissect.target.filesystems.tar.TarFilesystem(fh: BinaryIO, base: Optional[str] = None, tarinfo: Optional[tarfile.TarInfo] = None, *args, **kwargs)#

Bases: dissect.target.filesystem.Filesystem

Filesystem implementation for tar files.

__fstype__ = 'tar'#
get(path: str, relentry: Optional[dissect.target.filesystem.FilesystemEntry] = 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() bool#

Return whether this entry is a directory. Resolves symlinks when possible.

is_file() bool#

Return whether this entry is a file. Resolves symlinks when possible.

Return whether this entry is a link.

Read the link if this entry is a symlink. Returns a string.

Read the link if this entry is a symlink. Returns a filesystem entry.

stat() 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() 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.