swh.fuse.fs.entry module#

class swh.fuse.fs.entry.EntryMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: IntEnum

Default entry mode and permissions for the FUSE.

The FUSE mount is always read-only, even if permissions contradict this statement (in a context of a directory, entries are listed with permissions taken from the archive).

RDONLY_FILE = 33060#
RDONLY_DIR = 16749#
RDONLY_LNK = 41252#
RDWR_DIR = 16877#
class swh.fuse.fs.entry.FuseEntry(name: str, mode: int, depth: int, fuse: Fuse)[source]#

Bases: object

Main wrapper class to manipulate virtual FUSE entries

name: str#

entry filename

mode: int#

entry permission mode

depth: int#
fuse: Fuse#

internal reference to the main FUSE class

inode: int#

unique integer identifying the entry

file_info_attrs: Dict[str, Any]#
async size() int[source]#

Return the size (in bytes) of an entry

get_relative_root_path() str[source]#
create_child(constructor: Any, **kwargs) FuseEntry[source]#
class swh.fuse.fs.entry.FuseFileEntry(name: str, mode: int, depth: int, fuse: Fuse)[source]#

Bases: FuseEntry

FUSE virtual file entry

async get_content() bytes[source]#

Return the content of a file entry

async size() int[source]#

Return the size (in bytes) of an entry

class swh.fuse.fs.entry.FuseDirEntry(name: str, mode: int, depth: int, fuse: Fuse)[source]#

Bases: FuseEntry

FUSE virtual directory entry

ENTRIES_REGEXP: Pattern | None = None#
async size() int[source]#

Return the size (in bytes) of an entry

validate_entry(name: str) bool[source]#

Return true if the name matches the directory entries regular expression, and false otherwise

async compute_entries()[source]#

Return the child entries of a directory entry

async get_entries(offset: int = 0) AsyncIterator[FuseEntry][source]#

Return the child entries of a directory entry using direntry cache

async lookup(name: str) FuseEntry | None[source]#

Look up a FUSE entry by name

class swh.fuse.fs.entry.FuseSymlinkEntry(name: str, depth: int, fuse: Fuse, target: str | bytes | Path)[source]#

Bases: FuseEntry

FUSE virtual symlink entry

mode: int = 41252#

entry permission mode

target: str | bytes | Path#

path to symlink target

async size() int[source]#

Return the size (in bytes) of an entry

get_target() str | bytes | Path[source]#

Return the path target of a symlink entry