1
0
Fork 0
mirror of https://github.com/vi/execfuse synced 2025-12-30 22:16:21 +00:00
No description
Find a file
2025-05-08 20:17:12 +03:00
examples Merge remote-tracking branch 'originpull/11/head' 2024-08-15 21:53:20 +02:00
.gitignore testuml: Nicer mode of operation 2015-01-21 17:54:34 +03:00
.travis.yml Try fixing Travis 2018-05-14 16:06:06 +03:00
chunked_buffer.c Avoid malloc.h, standard headers suffice [#2] 2024-08-14 00:34:10 +02:00
chunked_buffer.h stage wip 2013-07-13 01:57:18 +03:00
chunked_buffer_test.c *.c: standardize coding style 2024-08-13 21:37:37 +02:00
common.h *.c: standardize coding style 2024-08-13 21:37:37 +02:00
Config.in added buildroot package-file 2024-11-29 14:30:24 +01:00
execfuse.c Merge remote-tracking branch 'originpull/11/head' 2024-08-15 21:53:20 +02:00
execfuse.mk added buildroot package-file 2024-11-29 14:30:24 +01:00
execute_script.c typo 2025-05-08 16:24:47 +02:00
execute_script.h *.c: standardize coding style 2024-08-13 21:37:37 +02:00
execute_script_test.c *.c: standardize coding style 2024-08-13 21:37:37 +02:00
LICENSE README 2013-07-13 05:15:36 +03:00
Makefile Fix trailing whitespace 2024-08-13 21:29:10 +02:00
README.md added buildroot package-file 2024-11-29 14:30:24 +01:00
tests.sh Fix testing on Travis: don't use fusermount when running as root 2015-07-06 19:34:20 +03:00
umltest.sh testuml: Nicer mode of operation 2015-01-21 17:54:34 +03:00

execfuse is a implement FUSE filesystems using a bunch of scripts.

Consider it as a "shell FUSE binding".

For each FUSE call (except of ones that deals with file descriptors) execfuse calls your script. For opening files it provides a bit higher level abstraction: "read_file" script is called when file should be read and "write_file" is called when file should be saved.

Example:

$ mkdir -p m
$ ./execfuse examples/xmp m
$ ls -l m/bin/sh
lrwxrwxrwx 1 root root 4 Mar 26 00:26 m/bin/sh -> bash
(executes "examples/xmp/readlink /bin/bash" for this)
$ ls m/etc/iproute2/
ematch_map  group  rt_dsfield  rt_protos  rt_realms  rt_scopes	rt_tables
(executes "exampels/xmp/readdir /etc/iproute" for this)
$ m/bin/echo qqq
qqq
$ mkdir -p m/tmp/1/2/3
$ echo 12345 > m/tmp/12345
(executes "exampels/xmp/write_file /tmp/12345" with content piped to stdin)
$ rm -Rf m/tmp/1*
$ fusermount -u m

Limitations:

  • Each file must fit in memory, can't write/read part of file
  • Slow by design
  • Limited error handling, especially for writing files
  • Modifications to files are visible only after file closing

Filesystem examples:

  • examples/xmp - try to be fusexmp_fh
  • examples/hello - very simple demo filesystem
  • examples/video_frames - extract frames from video as *.ppm files and enumerate keyframes (using ffmpeg)

Buildroot instructions

Execfuse is very useful on embedded tiny linuxsystems (which might have few a [shell]scripting languages instead of a fullblown c-compiler).

  1. put this repo into the 'packages`-folder (see buildroot manual)
  2. update the EXECFUSE_SITE-path accordingly.