| fs | made shellscript more extendable | |
| .gitignore | gitignore | |
| Config.in | master: work in progress [might break] | |
| fusescript.c | master: update documentation | |
| fusescript.mk | master: work in progress [might break] | |
| fusescript.nix | master: work in progress [might break] | |
| fusescript.svg | master: work in progress [might break] | |
| LICENSE | master: update documentation | |
| Makefile | master: work in progress [might break] | |
| README.md | master: update documentation | |
Fusescript
scriptable filesystems via python,lua,awk,shellscript etc.
Hackable & prototypable FUSE3 script-bindings for your favorite programming language!
"offer a filesystem like interface to everything" ~ dr. Ben Martin (libferris)
Usage
$ mkdir /mnt/helloworld
$ fusescript fs/helloworld /mnt/helloworld # <-- fs/helloworld = a shellscript(!)
$ ls /mnt/helloworld
file1
$ cat /mnt/helloworld/file1
Hello world
Profit! The helloworld-script serves a 'virtual filesystem' on the fly ❤
To see how this works, see the fs/helloworld shellscript, or the python, nodejs, AWK script.
Compile
- nix:
nix-build fusescript.nix - debian:
sudo apt-get install libfuse3-dev && make - buildroot [embedded]: put this repository in the
packagesdirectory and select it in 'External' (last menuitem when runningmake menuconfig)
to debug add the
-dflag (fusescript fs/helloworld /mnt/helloworld -de.g.)
Sorting / Metadata
You can let your script respond to extended attributes, and query the filesystem like a database:
$ attr -s author -V 'John Doe' dir_or_file
$ getfattr -d dir_or_file
$ find . -type f -exec attr -l {} \; | grep "author=John Doe"
read/write attributes via the defacto utilities:
- Windows:
fsutil ads create <file> <attribute_name> <attribute_value> - macOS:
xattr -w <attribute_name> <attribute_value> <file> - Linux:
attr -s <attribute_name> <attribute_value> <file> - Linux:
attr -s <attribute_name> <attribute_value> <file>
Rationale
- App-development usually adds various layers of tree-structures
- the filesystem is already a tree-structure
Fusescript is an exploration into mapping things to a filesystem asap.
In such case, we'd want to prototype with 1% FUSE-functionality, without being forced into building/debugging C (on an embedded device).
"Files are awesome, everything depends on it"
Crazy ideas:
- navigate database via the filesystem
- navigate REST api via the filesystem
- navigate fileformat-internals via the filesystem
- you name it!
Inspired by
- https://github.com/monkeyiq/ferris
- https://github.com/vi/execfuse
- https://github.com/zevweiss/booze
- Future Of Text SLOAN companion
Projects using fusescript
Notes
Keep in mind that advanced prompts (liquidprompt, powerline e.g.) might flood the scripts with FUSE-calls.