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

options to list missing and/or unverified files #198

Open
kyle0r opened this issue Feb 27, 2022 · 6 comments
Open

options to list missing and/or unverified files #198

kyle0r opened this issue Feb 27, 2022 · 6 comments
Labels

Comments

@kyle0r
Copy link

kyle0r commented Feb 27, 2022

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:

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

  2. 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?

@rhash rhash added the FR label Jun 13, 2022
@rhash
Copy link
Owner

rhash commented Jun 13, 2022

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

@i2324561w2
Copy link

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!

@kyle0r
Copy link
Author

kyle0r commented Jun 17, 2022

@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

image

cite: https://explainshell.com/explain?cmd=cfv+-rumf+storeX-run1.sfv

@Perkolator
Copy link

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.

@rhash
Copy link
Owner

rhash commented Jul 27, 2023

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

@Perkolator
Copy link

Perkolator commented Jul 28, 2023

So the --unverified option 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants