remFS is a network filesystem which is accessed over HTTP. The core design principle comes from this Alan Kay quote:
"Simple things should be simple, complex things should be possible." - Alan Kay
remFS servers choose from discrete sets of "features" to implement. These features are designed to be complimentary but independent, and it's likely that additional features will be made available over time (such as auth). The current features are read, write, events, and perf. read, write, and events all add functionality. In theory, anything you would want to do with a filesystem can be done with only these features. In practice, perf is necessary in order to achieve good performance for many real-world applications. The corresponding functionality for each feature is listed in the following table:
| read |
|---|
|
| write |
|
| events |
|
| perf |
|
It is recommended for remFS servers to indicate which features each file or directory supports, like this:
{
"features": {
"read": true,
"write": true,
"events": true,
"perf": false,
},
"type": "dir",
"children": {
}
}This information is not mandatory. If missing, clients can simply attempt the desired request, and the server can indicate an error if it's not supported.
If the information is provided in a given directory of the filesystem (for example at the root), it can be omitted for any descendants of that directory. Features are assumed to be the same down the tree until new values are encountered. This allows for implementing rudimentary permissions functionality.
The read feature is designed in such a way that read-only remFS servers can implemented using nothing but an off-the-shelf static file HTTP server and a hand-written remfs.json file. For example, if you had the following directory structure:
d1/
f1.txt
f2.mp3
d2/
f3.pdf
f4.md
You could create this remfs.json file:
{
"type": "dir",
"children": {
"f1.txt": {
"type": "file"
},
"f2.mp3": {
"type": "file"
},
"d2": {
"type": "dir",
"children": {
"f3.pdf": {
"type": "file"
},
"f4.md": {
"type": "file"
}
}
}
}
}Place that file in d1, and start a static web server in that directory. The
server will be browseable as a read-only remFS filesystem.
Example JSON POST move:
{
"method": "move",
"srcPath": "/path/to/item",
"dstPath": "/path/to/destination"
}Example JSON POST concat:
{
"method": "concat",
"srcPaths": [
"/path/to/file1",
"/path/to/file2",
"/path/to/file3"
],
"dstPath": "/path/to/destination/file"
}