dissect.target.filesystems.cb#

Module Contents#

Classes#

CbFilesystem

Base class for filesystems.

CbFilesystemEntry

Base class for filesystem entries.

class dissect.target.filesystems.cb.CbFilesystem(cb, sensor, session, prefix, *args, **kwargs)#

Bases: dissect.target.filesystem.Filesystem

Base class for filesystems.

__fstype__ = 'cb'#
static detect(fh)#

Detect whether the fh file-handle contains a Filesystem implementation.

Parameters:

fh – A file-like object, usually an image of a disk.

Returns:

True if fh contains the filesystem, False otherwise.

get(path)#

Retrieve a FilesystemEntry from the filesystem.

Parameters:

path – the path which we want retrieve.

Returns:

A FilesystemEntry(path) kind of object.

class dissect.target.filesystems.cb.CbFilesystemEntry(fs: Filesystem, path: str, entry: FilesystemEntry)#

Bases: dissect.target.filesystem.FilesystemEntry

Base class for filesystem entries.

get(path)#

Retrieve a FilesystemEntry relative to this entry.

Parameters:

path – The path relative to this filesystem entry.

Returns:

A relative FilesystemEntry.

open()#

Open this filesystem entry.

Returns:

A file-like object. Resolves symlinks when possible

iterdir()#

Iterate over the contents of a directory, return them as strings.

Returns:

An iterator of directory entries as path strings.

scandir()#

Iterate over the contents of a directory, return them as FilesystemEntry’s.

Returns:

An iterator of directory entries as FilesystemEntry’s.

is_dir()#

Determine if this entry is a directory, resolving symlinks when possible.

Returns:

True if the entry is a directory, False otherwise.

is_file()#

Determine if this entry is a file, resolving symlinks when possible.

Returns:

True if the entry is a file, False otherwise.

Determine wether this entry is a symlink.

Returns:

True if the entry is a symbolic link, False otherwise.

stat()#

Determine the stat information of this entry, resolving any symlinks.

If the entry is a symlink, it gets resolved, attempting to stat the path where to points to.

Returns:

The stat information of this entry.

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.

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.

abstract lstat()#

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.

attr()#

The attributes related to this entry, resolving any symlinks.

If the entry is a symbolic link, it will attempt to resolve it first. Resulting in the attr information of the entry it points to.

Returns:

The attributes of this entry.

lattr()#

The attributes related to this current entry, without resolving links.

Returns:

The attributes of this entry.