swh.fuse.fs.entry module

class swh.fuse.fs.entry.EntryMode(value)[source]

Bases: enum.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) swh.fuse.fs.entry.FuseEntry[source]
class swh.fuse.fs.entry.FuseFileEntry(name: str, mode: int, depth: int, fuse: Fuse)[source]

Bases: swh.fuse.fs.entry.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

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]
class swh.fuse.fs.entry.FuseDirEntry(name: str, mode: int, depth: int, fuse: Fuse)[source]

Bases: swh.fuse.fs.entry.FuseEntry

FUSE virtual directory entry

ENTRIES_REGEXP: Optional[Pattern] = 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

get_entries(offset: int = 0) AsyncIterator[swh.fuse.fs.entry.FuseEntry][source]

Return the child entries of a directory entry using direntry cache

async lookup(name: str) Optional[swh.fuse.fs.entry.FuseEntry][source]

Look up a FUSE entry by name

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

Bases: swh.fuse.fs.entry.FuseEntry

FUSE virtual symlink entry

mode: int = 41252

entry permission mode

target: Union[str, bytes, Path]

path to symlink target

async size() int[source]

Return the size (in bytes) of an entry

get_target() Union[str, bytes, pathlib.Path][source]

Return the path target of a symlink entry