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

entry filename

Type

str

mode

entry permission mode

Type

int

fuse

internal reference to the main FUSE class

Type

Fuse

inode

unique integer identifying the entry

Type

int

name: str
mode: int
depth: int
fuse: Fuse
inode: int
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
mode: int
depth: int
fuse: Fuse
inode: int
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() → Sequence[swh.fuse.fs.entry.FuseEntry][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)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

target

path to symlink target

Type

Union[str, bytes, pathlib.Path]

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