1
1
mirror of https://github.com/mgree/ffs.git synced 2024-09-17 14:07:15 +03:00
the file filesystem: mount semi-structured data (like JSON) as a Unix filesystem
Go to file
Michael Greenberg 1830074f32 more debug
2021-06-16 17:46:18 -04:00
.github/workflows fix dirs 2021-06-07 21:55:24 -04:00
json math is hard 2021-06-14 12:00:39 -04:00
src more debug 2021-06-16 17:46:18 -04:00
tests more debug 2021-06-16 17:46:18 -04:00
.gitignore deps building 2021-06-07 11:22:07 -04:00
Cargo.lock update to fuser 0.8.0 2021-06-13 21:02:54 -04:00
Cargo.toml update to fuser 0.8.0 2021-06-13 21:02:54 -04:00
LICENSE GPLv3 2021-06-07 08:23:14 -07:00
README.md migrate TODO to issues [ci skip] 2021-06-15 15:34:56 -04: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.

$ ffs mnt json_eg1.json  &
[1] 80762
$ tree mnt
mnt
└── glossary
    ├── GlossDiv
    │   ├── GlossList
    │   │   └── GlossEntry
    │   │       ├── Abbrev
    │   │       ├── Acronym
    │   │       ├── GlossDef
    │   │       │   ├── GlossSeeAlso
    │   │       │   │   ├── 0
    │   │       │   │   └── 1
    │   │       │   └── para
    │   │       ├── GlossSee
    │   │       ├── GlossTerm
    │   │       ├── ID
    │   │       └── SortAs
    │   └── title
    └── title

6 directories, 11 files
$ cat mnt/glossary/GlossDiv/GlossList/GlossEntry/Abbrev
ISO 8879:1986$ cat mnt/glossary/GlossDiv/GlossList/GlossEntry/Acronym 
SGML$ cat mnt/glossary/title 
example glossary$ cat json_eg1.json 
{
    "glossary": {
        "title": "example glossary",
		"GlossDiv": {
            "title": "S",
			"GlossList": {
                "GlossEntry": {
                    "ID": "SGML",
					"SortAs": "SGML",
					"GlossTerm": "Standard Generalized Markup Language",
					"Acronym": "SGML",
					"Abbrev": "ISO 8879:1986",
					"GlossDef": {
                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
						"GlossSeeAlso": ["GML", "XML"]
                    },
					"GlossSee": "markup"
                }
            }
        }
    }
}
$ ps | grep ffs
80762 ttys001    0:00.03 ffs mnt json_eg1.json
80843 ttys001    0:00.00 grep ffs
$ umount mnt
[1]+  Done                    ffs mnt json_eg1.json
$

External dependencies

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

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