# Data Structures

pyfuse3.ENOATTR

  This errorcode is unfortunately missing in the `errno` module, so it is provided by pyfuse3 instead.

pyfuse3.ROOT_INODE

  The inode of the root directory, i.e. the mount point of the file system.

pyfuse3.RENAME_EXCHANGE

  A flag that may be passed to the `rename` handler. When passed, the handler must atomically exchange the two paths (which must both exist).

pyfuse3.RENAME_NOREPLACE

  A flag that may be passed to the `rename` handler. When passed, the handler must not replace an existing target.

pyfuse3.default_options

  This is a recommended set of options that should be passed to `pyfuse3.init` to get reasonable behavior and performance. pyfuse3 is compatible with any other combination of options as well, but you should only deviate from the defaults with good reason.

  (The `fsname=<foo>` option is guaranteed never to be included in the default options, so you can always safely add it to the set).

  The default options are:

  - `default_permissions` enables permission checking by kernel. Without this any umask (or uid/gid) would not have an effect.

exception pyfuse3.FUSEError

  This exception may be raised by request handlers to indicate that the requested operation could not be carried out. The system call that resulted in the request (if any) will then fail with error code errno_.

class pyfuse3.FileHandleT

  A type alias for `int`, representing an integer file handle produced by a `create`, `open`, or `opendir` call.

class pyfuse3.FileNameT

  A type alias for `bytes`, representing a file name, with no embedded zero-bytes (`\0`).

class pyfuse3.FlagT

  A type alias for `int`, representing flags modifying the behavior of an operation.

class pyfuse3.InodeT

  A type alias for `int`, representing an inode number.

class pyfuse3.ModeT

  A type alias for `int`, representing a file mode.

class pyfuse3.XAttrNameT

  A type alias for `bytes`, representing an extended attribute name, with no embedded zero-bytes (`\0`).

class pyfuse3.RequestContext

  Instances of this class are passed to some `Operations` methods to provide information about the caller of the syscall that initiated the request.

  pid
  uid
  gid
  umask

class pyfuse3.StatvfsData

  Instances of this class store information about the file system. The attributes correspond to the elements of the `statvfs` struct, see statvfs(2) for details.

  f_bsize
  f_frsize
  f_blocks
  f_bfree
  f_bavail
  f_files
  f_ffree
  f_favail
  f_namemax

class pyfuse3.EntryAttributes

  Instances of this class store attributes of directory entries. Most of the attributes correspond to the elements of the `stat` C struct as returned by e.g. `fstat` and should be self-explanatory.

  st_ino
  generation

    The inode generation number

  entry_timeout

    Validity timeout for the name/existence of the directory entry

    Floating point numbers may be used. Units are seconds.

  attr_timeout

    Validity timeout for the attributes of the directory entry

    Floating point numbers may be used. Units are seconds.

  st_mode
  st_nlink
  st_uid
  st_gid
  st_rdev
  st_size
  st_blksize
  st_blocks
  st_atime_ns

    Time of last access in (integer) nanoseconds

  st_ctime_ns

    Time of last inode modification in (integer) nanoseconds

  st_mtime_ns

    Time of last modification in (integer) nanoseconds

class pyfuse3.FileInfo

  Instances of this class store options and data that `Operations.open` returns. The attributes correspond to the elements of the `fuse_file_info` struct that are relevant to the `Operations.open` function.

  fh

    This attribute must be set to the file handle to be returned from `Operations.open`.

  direct_io

    If true, signals to the kernel that this file should not be cached or buffered.

  keep_cache

    If true, signals to the kernel that previously cached data for this inode is still valid, and should not be invalidated.

  nonseekable

    If true, indicates that the file does not support seeking.

class pyfuse3.SetattrFields

  `SetattrFields` instances are passed to the `setattr` handler to specify which attributes should be updated.

  update_atime

    If this attribute is true, it signals the `Operations.setattr` method that the `st_atime_ns` field contains an updated value.

  update_mtime

    If this attribute is true, it signals the `Operations.setattr` method that the `st_mtime_ns` field contains an updated value.

  update_mode

    If this attribute is true, it signals the `Operations.setattr` method that the `st_mode` field contains an updated value.

  update_uid

    If this attribute is true, it signals the `Operations.setattr` method that the `st_uid` field contains an updated value.

  update_gid

    If this attribute is true, it signals the `Operations.setattr` method that the `st_gid` field contains an updated value.

  update_size

    If this attribute is true, it signals the `Operations.setattr` method that the `st_size` field contains an updated value.

class pyfuse3.ReaddirToken

  An identifier for a particular `readdir` invocation.

class pyfuse3.PollHandle

  Opaque handle for delivering poll(2) readiness notifications.

  Instances of this class are created by pyfuse3 and passed to `Operations.poll`. The filesystem may keep a reference and later call `PollHandle.notify` on the handle to wake up any process currently blocked in poll(2), select(2) or epoll_wait(2) for the corresponding file descriptor.

  A single notification is sufficient to clear all pending waiters; filesystems should normally discard the handle after notifying.

  The underlying `fuse_pollhandle` is automatically destroyed when the Python object is garbage collected, so filesystems should simply drop the reference when the notification is no longer needed.

  notify()

    Notify IO readiness for this poll handle.

    After this returns, any process waiting in poll(2), select(2) or epoll_wait(2) on the corresponding file descriptor will be woken so it can re-poll the filesystem for the current readiness mask.

    Each `PollHandle` is intended for a single notification. After a successful call, the filesystem should discard the handle and not call this method again.