cfv − Verify file consistency with .sfv, .csv, .crc, .md5, md5sum, sha1sum, .torrent, par, or par2 files |
cfv [−p dir] [−v|−V|−VV] [−r|−rr|−R] [−n|−N] [−−renameformat <s>] [−s|−S] [−zz|−z|−Z|−ZZ] [−T|−C] [−m|−M] [−i|−I] [−u|−uu|−U] [−−unquote <b>] [−−fixpaths <s>] [−−showpaths <i>] [−−list/−−list0 <l>] [−−announceurl <u>] [−−piece_size_pow2 <n>] [−t type] [−f file] [files...] |
cfv verifies that the files you have are the same as those that the were used to create the checksum file. |
−v |
Enable printing of extra messages. |
||
−V |
Disable printing of extra messages. (default) |
||
−VV |
Like −V, but don’t print status line at end either. |
||
−q |
Like −VV, but not even error messages are printed. Check the exit status. |
||
−Q |
Only status lines are printed, but not individual errors. |
−−progress VAL |
Set when cfv should display progress bars. If no, progress bars are never displayed. If auto, progress bars are displayed when the output is to a tty.(default) If yes, progress is always displayed. |
−r |
Recursive mode 1. In create mode, make seperate chksum files for each dir. |
||
−rr |
Recursive mode 2. In create mode make a single file with deep listing in it. Both recursive modes are equivilant for test mode. |
||
−R |
Disable recursive mode (default) |
||
−l |
Follow directory symlinks in recursive mode. (default) |
||
−L |
Don’t follow directory symlinks in recursive mode. |
||
−T |
Set test mode. (default) |
||
−C |
Set create mode. |
||
−m |
Check only for missing files (don’t compare checksums) |
||
−M |
Check checksums (default) |
||
−n |
Rename bad files. With −s, also renames misnamed files to the correct name. |
||
−N |
Don’t rename bad files (default) |
−−renameformat string |
Format string to use with −n option. Simply, put
any of the 4 strings %(fullname)s, %(name)s, %(ext)s, and
%(count)i in the format string, along with whatever other
text you wish. |
−s |
Search for misnamed files. No effect in create mode. Also, keep in mind that using −m together with −s will do nothing if the checksum type doesn’t include filesizes, and if it does, can give false positives if some files have the same size. |
||
−S |
Don’t search for misnamed files. (default) |
||
−i |
Ignore case. Currently has no effect in create mode. |
||
−I |
Don’t ignore case (default) |
||
−u |
Show unverified files. If no files in a directory are verified, shows dir/*. If no files in a directory or its subdirs are verified, shows dir/**. Has no effect in create mode. |
||
−uu |
Show each unverified file individually, no special directory handling. Has no effect in create mode. |
||
−U |
Don’t show unverified files (default) |
||
−zz |
Force making/reading checksum files as gzipped files, even if not ending in .gz (mainly useful for "−f −") |
||
−z |
Make gzipped files in create mode. |
||
−Z |
Don’t create gzipped files automatically. (default) |
||
−ZZ |
Never use gzip, even if file ends in ".gz". |
−−unquote BOOL |
If yes, handle checksum files that were generated by buggy encoders that quote filenames in checksum formats that don’t need it. Default is no, since quotes can be a valid character in a filename and we don’t want to remove them if they are actually part of the filename. |
−−fixpaths string |
Convert all occurances of any characters in string to the dir seperator for the current platform. No effect in create mode. Use an empty string to disable. |
−−strippaths VAL |
Strip NUM leading components from file names in test mode. Similar to the −p/−−strip options of patch. VAL may be ’none’: leave exactly as is, ’all’: strip everything but the filename, 0: strip the leading driveletter/slash (if any), 1+: strip this many path components in addition. The default is 0. |
−−showpaths VAL |
Show paths in displayed filenames. VAL should be one of yes/1/no/0/auto/2 or absolute/relative, or one from first list and one from second joined by a −. For backwards compatability, 1=yes, 0=none, 2=auto. The default is auto−relative. Abrieviations are accepted. Examples: −−showpaths=y−a always shows absolute paths. −−showpaths=n never shows paths. |
−p dir |
Change to directory before doing anything. |
−f file |
Specify the name of the checksum file to test or create. If file is −, stdin (for −T) or stdout (for −C) will be used. |
−t type |
Specify the type of the file. Can be sfv, sfvmd5, csv, csv2, csv4, sha1, md5, bsdmd5, par, par2, torrent, crc, auto, or help. If the type is help, or an unknown type is given, a list of the types and their descriptions will be printed. The default is auto, which will detect the file type for you. When creating, if type is auto an sfv will be made, unless a different default has been set in the config file. |
−−list listset |
Prints a raw listing of files in the given set (ok, bad, unverified, notfound). Usually used with −q, but not strictly needed since specifying −−list will redirect all other messages to stderr. |
−−list0 listset |
Like −−list but files are seperated by a null char. Useful in combination with xargs −0. |
−−announceurl URL |
Tracker announce URL for .torrent file creation. |
−−piece_size_pow2 N |
Power of two to set piece size to for .torrent file creation. The default is 18, which gives a piece size of 2^18=256KB. |
−h/−−help |
Print help info. |
−−version |
Print version of cfv and modules it uses. |
sfv is a Simple File Verify format file |
The exit status of cfv can be examined to determine what kind of errors, if any, occured. An exit status of 1 indictates a command line argument error, or an unhandled exception. Otherwise, the exit status will be a bitwise OR of: |
2 |
badcrc (a file had a different checksum than listed in the checksum file) |
||
4 |
badsize (a file had a different size than listed. Not all checksum file formats include file size) |
||
8 |
notfound (a file that was listed was not found) |
||
16 |
ferror (some other file error occured when trying to open/read a file) |
||
32 |
unverified (a file was not verified, only with −u) |
||
64 |
cferror (a checksum file was not found or not recognized) |
Since different platforms represent the path seperator differently, using recursive mode 2 (−rr) is not recommended for anything other than personal usage. Although the addition of the fixpaths option can be used to work around this, it isn’t guaranteed that whatever program others user have will have a similar feature. The −s option is not currently implemented for .torrent files. (Unless you also use −m) |
If no options are specified, the default will be −T
−t auto, and it will search the current directory for
any supported checksum files. Force the file to test: Test only the files you have, (avoid file not found
errors): Create a csv file for all the files in the current
dir: Create a csv file for only the zip files in the current
dir, and specify the filename: Check if all files in current and subdirs are verified,
but don’t verify checksums of files that are. (For
example, before writing a directory to a cdr and you want to
make sure all the files are verified.): |
Upon startup, cfv will test for ~/.cfvrc and if it exists, read configuration information from it. The file consists of any number of lines, each having a single option name and the value seperated by a space. Empty lines and lines beginning with a # are ignored. |
#this is an example .cfvrc that specifies all the default
options #torrent options: |
~/.cfvrc |
cfv configuration file. See configuration section. |
~/_cfvrc |
alternate configuration file name. (Since windows won’t let you create files starting with a dot.) |
HOME |
Where to look for cfvrc file. Note that win9x doesn’t set this to anything automatically. |
CFV_NOFCHKSUM |
Set to a non-empty value to disable usage of python-fchksum module. |
CFV_NOMMAP |
Set to a non-empty value to disable usage of mmap. |
Matthew Mueller <donut AT dakotacom DOT net> The latest version can be found at any of: Other programs I have written can be found at: |
md5sum(1), sha1sum(1), md5(1), xargs(1) |