SSFS: A Virtual Filesystem to Organize Files by Extension

SSFS is a virtual filesystem that organizes file by their extensions (eg.: .c, .py, .png,…). It provides a simple way to see the various types of files present, and easy bulk deletion of file types. It is built using the FUSE interface and overrides Unix filesystem calls.

struct fuse_operations ss_ops = {
    .getattr = ss_getattr,
    .readdir = ss_readdir,
    .open = ss_open,
    .read = ss_read,
    .write = ss_write,
    .unlink = ss_unlink,
    .opendir = ss_opendir,
    .rmdir = ss_rmdir,
    .truncate = ss_truncate,
    .ftruncate = ss_ftruncate,

SSFS is a 2 level filesystem. The root contains folders, each representing an extension found. Each folder contains the files with that extension. Directories and files without extensions are ignored.

While mounting, one must specify a mount point, and a directory to be scanned. The names of the files in the virtual filesystem are replaced with the full path of the file.


Terminal View

] are used as forward slashes are not allowed in file names.


Filesystem in a file browser: 1) The actual directory being scanned. 2) SSFS root. 3) Inside +c folder.

Source code available on GitHub.

#fuse, #unix-filesystem