dissect.target.filesystems.cb

Module Contents

Classes

OS

Enum where members are also (and must be) ints

CbFilesystem

Base class for filesystems.

CbDirEntry

Directory entry base class. Closely models os.DirEntry.

CbFilesystemEntry

Base class for filesystem entries.

Attributes

dissect.target.filesystems.cb.HAS_CARBON_BLACK = True
dissect.target.filesystems.cb.CB_TIMEFORMAT = '%Y-%m-%dT%H:%M:%S%fZ'
class dissect.target.filesystems.cb.OS

Bases: enum.IntEnum

Enum where members are also (and must be) ints

WINDOWS = 1
LINUX = 2
MAC = 4
class dissect.target.filesystems.cb.CbFilesystem(session: cbc_sdk.live_response_api.LiveResponseSession, prefix: str, *args, **kwargs)

Bases: dissect.target.filesystem.Filesystem

Base class for filesystems.

__type__ = 'cb'

A short string identifying the type of filesystem.

session
prefix
static detect(fh: BinaryIO) bool

Detect whether the fh file-handle is supported by this Filesystem implementation.

The position of fh will be restored before returning.

Parameters:

fh – A file-like object, usually a disk or partition.

Returns:

True if fh is supported, False otherwise.

get(path: str) CbFilesystemEntry

Returns a CbFilesystemEntry object corresponding to the given path.

class dissect.target.filesystems.cb.CbDirEntry(fs: Filesystem, path: str, name: str, entry: Any)

Bases: 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.

Parameters:
  • fs – The filesystem the entry belongs to.

  • path – The path of the parent directory.

  • name – The name of the entry.

  • entry – The raw entry backing this directory entry.

fs: CbFilesystem

The filesystem the entry belongs to.

entry: tuple[dict[str, Any], str]

The raw entry backing this directory entry.

get() CbFilesystemEntry

Retrieve the FilesystemEntry this directory entry points to.

Subclasses should override this method to provide an efficient implementation.

stat(*, follow_symlinks: bool = True) dissect.target.helpers.fsutil.stat_result
class dissect.target.filesystems.cb.CbFilesystemEntry(fs: dissect.target.filesystem.Filesystem, path: str, entry: Any, cbpath: str)

Bases: dissect.target.filesystem.FilesystemEntry

Base class for filesystem entries.

cbpath
get(path: str) CbFilesystemEntry

Get a filesystem entry relative from the current one.

open() BinaryIO

Returns file handle (file-like object).

scandir() collections.abc.Iterator[CbDirEntry]

List the directory contents of this directory. Returns a generator of filesystem entries.

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.

Return whether this entry is a link.

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.