easy_fuser

Module posix_fs

Source
Expand description

§POSIX Filesystem Operations Module

This module provides a set of functions that wrap POSIX filesystem operations, making them more convenient to use within a Rust-based FUSE (Filesystem in Userspace) implementation. It offers a layer of abstraction over low-level system calls, handling conversions between Rust types and C types, as well as error handling.

§Key Features:

  • File type and attribute conversions between standard Rust types and FUSE-specific types.
  • Bridge layer between POSIX-compliant system calls and libfuse filesystem operations.
  • Error handling using custom PosixError type.
  • Utilities for working with file descriptors, paths, and system time.

§Usage:

This module is designed to be used as part of a larger FUSE implementation. It provides the necessary tools to interact with the underlying filesystem in a POSIX-compliant manner, while presenting the data in a format suitable for FUSE operations.

Note: Some operations, especially those involving symlinks, may require special handling or additional considerations.

Functions§

  • Checks file accessibility based on the process’s real user and group IDs.
  • Converts std::fs::Metadata to FileAttribute expected by fuser.
  • Converts a std::fs::FileType to the corresponding FileKind expected by fuse_api.
  • Copies a range of data from one file to another.
  • Creates and opens a new file with specified permissions and flags.
  • Manipulates the allocated disk space for a file.
  • Flushes any buffered data to the file system for the given file descriptor.
  • Synchronizes a file’s in-core state with storage device.
  • Retrieves file attributes for a given file descriptor.
  • Equivalent to the fuse function of the same name/// Retrieves an extended attribute for a file or directory.
  • Lists extended attributes for a file or directory.
  • Retrieves file attributes for a given path.
  • Repositions the file offset of the open file descriptor.
  • Creates a new directory at the specified path with the given mode and umask.
  • Creates a new file node (device special file or named pipe) at the specified path.
  • Opens a file at the specified path with given flags.
  • Reads data from a file descriptor at a specified offset.
  • Reads the contents of a directory.
  • Reads the target of a symbolic link.
  • Releases a file descriptor, closing the associated file.
  • Renames a file or directory from the old path to the new path.
  • Removes an empty directory at the specified path.
  • Modifies file attributes for a given path.
  • Sets an extended attribute for a file or directory.
  • Retrieves file system statistics for the specified path.
  • Creates a symbolic link at the specified path, pointing to the given target.
  • Removes a file at the specified path.
  • Writes data to a file descriptor at a specified offset.