VerText is a proof-of-concept Virtual File System (VFS) in C++ using FUSE 3. It monitors writes and file operations inside a virtual directory and archives versions of files automatically.
This version in the vertext repository is a modernized, refactored implementation leveraging C++20 features (specifically std::filesystem) for file system interactions and a customized, interactive dual-panel ncurses TUI for version inspection and recovery.
Unlike the legacy version, this repository uses:
std::filesystem: Replaces standard POSIX directory operations (opendir,readdir,mkdir,unlink) with C++20 filesystem pathways, improving platform safety and readability.- Dynamic Dual-Panel Focus Highlight: The ncurses TUI has been upgraded with color-coded window borders (active focus gets highlighted in green/bold, inactive in blue) to clearly show where keyboard navigation is currently active.
- Robust Path Resolution: Employs cleaner path resolution in
tui_main.cppusing hierarchical directory operations rather than manual string indexes.
sudo apt update
sudo apt install build-essential cmake libfuse3-dev libncurses-dev pkg-config-
Create and enter the build directory:
mkdir -p build cd build -
Configure with CMake & Compile:
cmake .. make
This generates two binaries:
vfs_mount: The FUSE mounting daemon.vfs_tui: The interactive version control inspector.
Use the helper scripts provided:
# Mount to default path (/tmp/vfs_mount) in the background
./scripts/mount.sh
# Mount to a custom directory in the foreground for debug logs
./scripts/mount.sh <custom_mount_path> -fOpen the version inspector interface:
./scripts/run_tui.shUP / DOWN(ork / j): Navigate lists.TAB: Toggle focus between the Files panel and the Version history panel.ENTER: Select a file to load its version history.R: Restore the selected version back to the active virtual workspace.V: View the text content of the selected version directly in a popup viewer.H: Display the Help dialog.Q: Quit the TUI.
To properly unmount and exit:
./scripts/unmount.sh