options to list missing and/or unverified files
Thanks for the great software. I've been enjoying using rhash as an alternative to the python based cfv.
Two use cases I cannot seem to currently cover with rhash as follows:
-
It doesn't seem to be possible to run the program to skip checksum verification and only show a list of missing files, i.e. in the checksum file but not present in the file hierarchy.
-
It doesn't to be possible to run the program to skip checksum verification and only show a list of unverified files, i.e. not in the checksum file but present in the file hierarchy. One can think of this as listing the file(s) delta that would be added to the file in update mode?
What do you think about these possible enhancements?
@kyle0r, thanks for the good idea. Both options should be added. Here are some thoughts.
The first option can be named --show-missing (alternatively: --print-missing or --only-missing). It should work in '-c' and '-cu' modes.
For the second option we need to think of good name, something like --show-absent or --show-unpresent. It should work in '-u' and '-cu' modes.
Another point to think on is the output format: if both options are specified, then how the missing files will be separated from the absent files? I would like to avoid new internationalization/localization work. The answer should depend on real use-cases. Will users read the output or parse is with some script? And do users actually need to specify both options at once? The simplest solution seems to separate both lists just by a newline.
In my opinion you could also have the 2 options mutually exclusive. And what is "-cu" mode? In the manual it's not written. As for the name you could also call them Laurel and Hardy, I don't see the problem!
@rhash I'll provide some sample outputs from the cfv util in the coming days.
It might be possible to reuse existing localisation if the options were mutually exclusive, as the user would know what output to be expecting from the requested option?
From my notes/docs I have the following command:
# check for unverified or missing files (not checksums)
time cfv -rumf storeX-run1.sfv

cite: https://explainshell.com/explain?cmd=cfv+-rumf+storeX-run1.sfv
So, these are implemented in 1.4.4? As --unverified=<file> and --missing=<file>?
How to use these? I don't understand the syntax. Whatever I try, I get some RHash error about the syntax, or just no output at all.
$ touch a.txt
$ touch b.txt
$ rhash --sfv [ab].txt > ../1.sfv
$ rm b.txt && touch c.txt
$ rhash --recursive --unverified ../1.sfv .
c.txt
$ rhash --missing ../1.sfv
b.txt
So the --unverified option requires files or directories to be provided at command line, while the --missing option looks into the current directory.
So the
--unverifiedoption requires files or directories to be provided at command line
Ah, ok. Thanks. I was expecting that rhash would automatically check the current working folder (with rhash --unverified="../1.sfv"), and with --recursive additionally subfolders. The RHash: no files/directories were specified at command line error confused me. :)
But, now it's not possible to do this: rhash --unverified="../1.sfv" . I.e. check only the provided folder, no subfolders. The error is: RHash: .: Is a directory. But this can be done for example with: rhash --unverified="../1.sfv" --file-list="../test.txt", where the text file is created with e.g. find . -maxdepth 1 -type f | sort -V (sort optional, but gives more human readable output). Would be easier with just rhash though.