ffs
ffs copied to clipboard
Empty file mounting fails
$> touch x.json
$> ffs x.son
thread 'main' panicked at 'JSON: Error("EOF while parsing a value", line: 1, column: 0)', src/format.rs:187:53
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
What did you expect to happen when you supplied invalid JSON?
(NB that a .json
file must contain exactly one value in the sense of RFC 8259.)
given the RFC the output is certainly OK but intuitively I would have expected an empty directory
If that's what you want, there's the --empty
flag.
That said, I'd accept a PR that implemented your behavior---you'd have to catch the error, identify that it's because of an empty file (parse error message/call stat
?), and then return an empty object. Might be good to create a --strict
flag that turns off this behavior, in case someone wants to rely on correct JSON/etc. parsing.