Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty file mounting fails #58

Open
nkh opened this issue Jan 10, 2022 · 3 comments
Open

Empty file mounting fails #58

nkh opened this issue Jan 10, 2022 · 3 comments
Labels
enhancement New feature or request format

Comments

@nkh
Copy link

nkh commented Jan 10, 2022

$> 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

@mgree
Copy link
Owner

mgree commented Jan 11, 2022

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.)

@mgree mgree added the format label Jan 11, 2022
@nkh
Copy link
Author

nkh commented Jan 12, 2022

given the RFC the output is certainly OK but intuitively I would have expected an empty directory

@mgree
Copy link
Owner

mgree commented Jan 12, 2022

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.

@mgree mgree added the enhancement New feature or request label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request format
Projects
None yet
Development

No branches or pull requests

2 participants