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
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

entry filename

mode

entry permission mode

fuse

internal reference to the main FUSE class

inode

unique integer identifying the entry

name: str
mode: int
depth: int
fuse: Fuse
inode: int
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

name: str
mode: int
depth: int
fuse: Fuse
inode: int
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

async size() → int[source]

Return the size (in bytes) of an entry

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

Look up a FUSE entry by name

name: str
mode: int
depth: int
fuse: Fuse
inode: int
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

target

path to symlink target

mode: int = 41252
target: Union[str, bytes, pathlib.Path]
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