FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_filesystems::ns_ciopfs::Ciopfs Class Referencefinal

FUSE-based case-insensitive filesystem wrapper. More...

#include <ciopfs.hpp>

Inheritance diagram for ns_filesystems::ns_ciopfs::Ciopfs:
[legend]
Collaboration diagram for ns_filesystems::ns_ciopfs::Ciopfs:
[legend]

Public Member Functions

 Ciopfs (pid_t pid_to_die_for, fs::path const &path_dir_lower, fs::path const &path_dir_upper, fs::path const &path_file_log)
 Constructs and mounts a CIOPFS filesystem.
 
Value< void > mount () override
 Mounts the CIOPFS filesystem.
 
- Public Member Functions inherited from ns_filesystem::Filesystem
virtual ~Filesystem ()
 Destroy the Filesystem:: Filesystem object, it un-mounts the filesystem and sends a termination signal.
 
 Filesystem (Filesystem &&)=default
 
 Filesystem (Filesystem const &)=delete
 
Filesystemoperator= (Filesystem &&)=default
 
Filesystemoperator= (Filesystem const &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from ns_filesystem::Filesystem
 Filesystem (pid_t pid_to_die_for, std::filesystem::path const &path_dir_mount, std::filesystem::path const &path_file_log)
 Construct a new Filesystem object.
 
- Protected Attributes inherited from ns_filesystem::Filesystem
pid_t m_pid_to_die_for
 
std::filesystem::path m_path_dir_mount
 
std::filesystem::path m_path_file_log
 
std::unique_ptr< ns_subprocess::Childm_child
 

Detailed Description

FUSE-based case-insensitive filesystem wrapper.

The Ciopfs class provides a managed interface to the CIOPFS filesystem. It handles the lifecycle of the CIOPFS process, including mounting, monitoring, and cleanup.

The filesystem creates a case-insensitive view of a source directory, allowing files to be accessed regardless of case. For example, "File.txt", "file.txt", and "FILE.TXT" would all refer to the same file.

Warning
CIOPFS requires FUSE support in the kernel
Note
This is a final class and cannot be inherited

Definition at line 61 of file ciopfs.hpp.

Constructor & Destructor Documentation

◆ Ciopfs()

ns_filesystems::ns_ciopfs::Ciopfs::Ciopfs ( pid_t pid_to_die_for,
fs::path const & path_dir_lower,
fs::path const & path_dir_upper,
fs::path const & path_file_log )
inline

Constructs and mounts a CIOPFS filesystem.

Creates a new CIOPFS instance and immediately attempts to mount it. The constructor will log an error if mounting fails but will not throw.

Parameters
pid_to_die_forProcess ID that this filesystem should monitor. When this process dies, the filesystem will unmount.
path_dir_lowerSource directory containing the actual files (case-sensitive)
path_dir_upperMount point where files will be accessible (case-insensitive)
Note
The directories will be created if they don't exist

Definition at line 101 of file ciopfs.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ mount()

Value< void > ns_filesystems::ns_ciopfs::Ciopfs::mount ( )
inlineoverridevirtual

Mounts the CIOPFS filesystem.

Performs the following steps:

  1. Creates source and mount directories if they don't exist
  2. Locates the CIOPFS binary in the system PATH
  3. Spawns the CIOPFS process with appropriate arguments
  4. Waits for FUSE to confirm the mount is ready

The spawned CIOPFS process will automatically terminate when the process specified by m_pid_to_die_for exits.

Returns
Value<void> Success or error with description
Note
This is a synchronous operation that blocks until mount is ready

Implements ns_filesystem::Filesystem.

Definition at line 129 of file ciopfs.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: