fad45bed4b
Extended attributes in `user.type` track the type of files and directories. Users can update these to alter the metadata. Loading files records types; serialization tries to use them (but will default to strings or bytes if it can't interpret the file appropriately). In particular, it's now possible to convert between both kinds of directories (list and named). This isn't a long term solution, because extended attributes have no real affordances---it's not obvious that they even exist, and even once you see `user.type`, it's obvious what it means or what values it has. #2 has other ideas about ways to represent and manipulate metadata. All of this comes with a few new flags and some brittle file ignoring behavior (macOS will generate `._*` files to hold extended attributes on filesystems that don't support them). The man page is updated with detail on the data model, and now the manpage is part of the website proper. |
||
---|---|---|
.github/workflows | ||
binary | ||
completions | ||
docs | ||
json | ||
man | ||
src | ||
tests | ||
toml | ||
yaml | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md | ||
run_tests.sh |
ffs: the file filesystem
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 [file]
to mount file.blah
at the mountpoint file
. The
final, updated version of the file will be outputted on stdout.
$ 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"}}
You can specify an explicit mountpoint by running ffs -m MOUNT file
;
you can specify an output file with -o OUTPUT
. You can edit a file
in place by running ffs -i file
---when the volume is unmounted, the
resulting output will be written back to file
.
External dependencies
You need an appropriate FUSE or macFUSE along with pkg-config.
See the GitHub build workflow for examples of external dependency installation.