1
0
Fork
You've already forked fusescript
0
easy functional virtual [FUSE] filesystems via python,lua,awk,shellscript etc.
C 59.1%
Shell 9.7%
Makefile 8.9%
JavaScript 7%
Python 4.6%
Other 10.7%
Find a file
2024年12月31日 13:43:46 +01:00
fs made shellscript more extendable 2024年12月31日 13:43:41 +01:00
.gitignore gitignore 2024年12月11日 14:15:41 +01:00
Config.in master: work in progress [might break] 2024年12月11日 14:15:55 +01:00
fusescript.c master: update documentation 2024年12月30日 12:49:52 +01:00
fusescript.mk master: work in progress [might break] 2024年12月11日 14:15:55 +01:00
fusescript.nix master: work in progress [might break] 2024年12月11日 14:15:55 +01:00
fusescript.svg master: work in progress [might break] 2024年12月11日 14:15:55 +01:00
LICENSE master: update documentation 2024年12月11日 14:51:20 +01:00
Makefile master: work in progress [might break] 2024年12月11日 14:15:55 +01:00
README.md master: update documentation 2024年12月31日 13:43:46 +01:00

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 packages directory and select it in 'External' (last menuitem when running make menuconfig)

to debug add the -d flag (fusescript fs/helloworld /mnt/helloworld -d e.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

Projects using fusescript

Notes

Keep in mind that advanced prompts (liquidprompt, powerline e.g.) might flood the scripts with FUSE-calls.