cfv(1)

NAME
cfv - Verify file concistency with .sfv, .csv, or md5sum files

SYNOPSIS
cfv [-p dir] [-v|-V|-VV] [-r|-rr|-R] [-n|-N] [--renameformat <s>] [-zz|-z|-Z|-ZZ] [-T|-C] [-m|-M] [-i|-I] [-u|-U] [--fixpaths <s>] [--showpaths <i>] [-t type] [-f file] [files...]

DESCRIPTION
cfv verifies that the files you have are the same as those that the were used to create the checksum file.

OPTIONS

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

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

-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

-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.
    The default is '%(name)s.bad-%(count)i%(ext)s'
    In detail, this is a standard python format string with mapping that contains {'fullname': original filename, 'name': fullname minus extension, 'ext': extension(including .), 'count': rename attempt}. If the format string does not contain count, then cfv will append '-%(count)i' to the filename if the first attempt fails.

-i  Ignore case. Currently has no effect in create mode.

-I  Don't ignore case (default)

-u  Show unverified files. Currently 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".

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

--showpaths int
    Show full paths 0:never, 1:always, 2:only in recursive mode(default)

-p dir
    Change to directory before doing anything.

-f file
    Specify the name of the checksum file to test or create.

-t type
    Specify the type of the file. Can be sfv, csv, csv2, csv4, md5, or auto. 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.

-h/--help
    Print help info.

--version
    Print version of cfv and modules it uses.

sfv is a simple file verify format file
csv is a comma seperated value file, with the fields being name,size,crc32,
csv2 is a comma seperated value file, with the fields being name,size,
md5 is md5sum format file

EXIT STATUS
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, only used in csv and csv4)

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)

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

EXAMPLES
If no options are specified, the default will be -T -t auto, and it will search the current directory for any sfv, csv, or md5sum files.
cfv

Force the file to test:
cfv -f funny.name

Test only the files you have, (avoid file not found errors):
cfv *

Create a csv file for all the files in the current dir:
cfv -C -tcsv

Create a csv file for only the zip files in the current dir, and specify the filename:
cfv -C -tcsv -fsomezips.csv *.zip

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.):
cfv -r -m -u

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

EXAMPLE CONFIGURATION
#this is an example .cfvrc that specifies all the default options
#don't be verbose (set to 1 for -v, 0 for -V, -1 for -VV)
verbose 0
#create sfv files by default
default sfv
#sort dir listings before creating a checksum file
dirsort 1
#sort command line specified files
cmdlinesort 1
#don't be recursive (set to 0 for -R, 1 for -r, 2 for -rr)
recursive 0
#don't show unverified files
showunverified 0
#don't ignore case
ignorecase 0
#don't fix any paths (note that there is a single space after fixpaths, thus the value it gets set to is an empty string)
fixpaths
#A more useful example would be:
#fixpaths /\
#show full paths in recursive mode (set to 0 for never, 1 for always, 2 for only in recursive mode)
showpaths 2
#access checksum filenames that end with .gz as gzipped files (-1 for never, 0 for with .gz, and 1 to make -C make .gz files automatically)
gzip 0
#don't rename bad files
rename 0
#format to use for renaming bad files with -n
renameformat %(name)s.bad-%(count)i%(ext)s

FILES

~/.cfvrc
    cfv configuration file. See configuration section.

BUGS
Specifying the [files...] arguments when using recursive test mode probably does not do what you want it to. (Comments or suggestions on desired behavior welcome.)

Show unverified files does not work correctly with checksum files that have deep listings (ie, ones made with -rr).

AUTHOR
Matt Mueller <donut@azstarnet.com>

The latest version, and other programs I have written, are available from:
http://www.azstarnet.com/~donut/programs/cfv.html

SEE ALSO
md5sum(1)