Open def-fun opened 1 year ago
Hi @def-fun while I agree this is a good idea and JHOVE should return meaningful codes, we just need to be careful what that means. Conventionally return codes are used to signify a genuine issue in execution, and I'm not convinced that an invalid file is the best case for a non-zero return code. The "File not found" error might be though. Any exception thrown during execution should also lead to a non-zero code. I'm not saying this is a definitive answer, would be interested to read your thoughts.
Another paradigm that is appearing are data oriented shells, spearheaded by tools like jq
for example, but also appearing in terminals designed entirely for this: https://www.nushell.sh/ -- you wouldn't need to go that far -- with JHOVE, JHOVE+JSON Output+jq
I am sure you could achieve the same.
I ran into this issue as well on automated archiving processes with file validation tasks. Would it be possible to add a pure optional argument for the CLI version that can reflect the (validation) status of the checked file in the return code?
Thanks for jhove, it saved lots of time to check integrity of files stored in my backup hard disk.
I think jhove can be more powerful, in my opinion, which means
unix like
and scriptable.jhove should return Non-zero value, so that we can make full use of jhove in shell/command line. For example, we can move bad files to
tmp_dir
firstly, then check them manually:but jhove return 0 even errors happen at present.