1
1
mirror of https://github.com/mgree/ffs.git synced 2024-08-16 14:50:35 +03:00
the file filesystem: mount semi-structured data (like JSON) as a Unix filesystem
Go to file
2021-06-24 11:05:57 -04:00
.github/workflows run tests in parallel, collect logs 2021-06-21 21:10:29 -04:00
binary Support other formats. (#11) 2021-06-20 18:20:06 -07:00
json Support other formats. (#11) 2021-06-20 18:20:06 -07:00
src change default behavior to modify newlines; update readme 2021-06-24 11:05:57 -04:00
tests change default behavior to modify newlines; update readme 2021-06-24 11:05:57 -04:00
toml Support other formats. (#11) 2021-06-20 18:20:06 -07:00
yaml Yaml support (#14) 2021-06-21 17:36:15 -07:00
.gitignore deps building 2021-06-07 11:22:07 -04:00
Cargo.lock Yaml support (#14) 2021-06-21 17:36:15 -07:00
Cargo.toml Yaml support (#14) 2021-06-21 17:36:15 -07:00
LICENSE GPLv3 2021-06-07 08:23:14 -07:00
README.md change default behavior to modify newlines; update readme 2021-06-24 11:05:57 -04:00
run_tests.sh Implement setattr (#22) 2021-06-23 17:36:12 -07:00

ffs: the file filesystem

Main workflow

ffs, the file filessytem, let's you mount semi-structured data as a fileystem---a tree structure you already know how to work with!

Working with semi-structured data using command-line tools is hard. Tools like jq help a lot, but learning a new language for simple manipulations is a big ask. By mapping hard-to-parse trees into a filesystem, you can keep using the tools you know.

Example

Run ffs [mountpoint] [file] to mount a file at a given mountpoint.

$ cat object.json 
{ "name": "Michael Greenberg", "eyes": 2, "fingernails": 10, "human": true }
$ ffs -o object_edited.json object.json &
[1] 60182
$ tree object
object
├── eyes
├── fingernails
├── human
└── name

0 directories, 4 files
$ echo Mikey Indiana >object/name
$ echo 1 >object/nose
$ mkdir object/pockets
$ cd object/pockets/
$ echo keys >pants
$ echo pen >shirt
$ cd ..
$ cd ..
$ umount object
$ 
[1]+  Done                    ffs -o object_edited.json object.json
$ cat object_edited.json 
{"eyes":2,"fingernails":10,"human":true,"name":"Mikey Indiana","nose":1,"pockets":{"pants":"keys","shirt":"pen"}}

External dependencies

You need an appropriate FUSE or macFUSE along with pkg-config.

See the GitHub build workflow for examples of external dependency installation.