1cfv(1)                      General Commands Manual                     cfv(1)
2
3
4

NAME

6       cfv  -  Verify  file  consistency  with .sfv, .csv, .crc, .md5, md5sum,
7       sha1sum, .torrent, par, or par2 files
8

SYNOPSIS

10       cfv [-p  dir]  [-v|-V|-VV]  [-r|-rr|-R]  [-n|-N]  [--renameformat  <s>]
11       [-s|-S]  [-zz|-z|-Z|-ZZ] [-T|-C] [-m|-M] [-i|-I] [-u|-uu|-U] [--unquote
12       <b>]  [--fixpaths   <s>]   [--showpaths   <i>]   [--list/--list0   <l>]
13       [--announceurl   <u>]  [--piece_size_pow2  <n>]  [-t  type]  [-f  file]
14       [files...]
15

DESCRIPTION

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

OPTIONS

21       -v     Enable printing of extra messages.
22
23       -V     Disable printing of extra messages. (default)
24
25       -VV    Like -V, but don't print status line at end either.
26
27       -q     Like  -VV,  but  not even error messages are printed.  Check the
28              exit status.
29
30       -Q     Only status lines are printed, but not individual errors.
31
32       --progress VAL
33              Set when cfv should display progress bars.  If no, progress bars
34              are  never displayed.  If auto, progress bars are displayed when
35              the output is to a tty.(default) If yes, progress is always dis‐
36              played.
37
38       -r     Recursive  mode  1.   In create mode, make seperate chksum files
39              for each dir.
40
41       -rr    Recursive mode 2.  In create mode make a single file  with  deep
42              listing  in  it.   Both  recursive modes are equivilant for test
43              mode.
44
45       -R     Disable recursive mode (default)
46
47       -l     Follow directory symlinks in recursive mode. (default)
48
49       -L     Don't follow directory symlinks in recursive mode.
50
51       -T     Set test mode. (default)
52
53       -C     Set create mode.
54
55       -m     Check only for missing files (don't compare checksums)
56
57       -M     Check checksums (default)
58
59       -n     Rename bad files.  With -s, also renames misnamed files  to  the
60              correct name.
61
62       -N     Don't rename bad files (default)
63
64       --renameformat string
65              Format  string  to use with -n option.  Simply, put any of the 4
66              strings %(fullname)s, %(name)s, %(ext)s, and  %(count)i  in  the
67              format string, along with whatever other text you wish.
68              The default is '%(name)s.bad-%(count)i%(ext)s'
69              In  detail, this is a standard python format string with mapping
70              that contains {'fullname': original filename,  'name':  fullname
71              minus  extension, 'ext': extension(including .), 'count': rename
72              attempt}.  If the format string does not contain count, then cfv
73              will  append  '-%(count)i'  to the filename if the first attempt
74              fails.
75
76       -s     Search for misnamed files.  No effect  in  create  mode.   Also,
77              keep  in  mind that using -m together with -s will do nothing if
78              the checksum type doesn't include filesizes, and if it does, can
79              give false positives if some files have the same size.
80
81       -S     Don't search for misnamed files. (default)
82
83       -i     Ignore case.  Currently has no effect in create mode.
84
85       -I     Don't ignore case (default)
86
87       -u     Show unverified files.  If no files in a directory are verified,
88              shows dir/*.  If no files in a directory or its subdirs are ver‐
89              ified, shows dir/**.  Has no effect in create mode.
90
91       -uu    Show  each  unverified  file  individually, no special directory
92              handling.  Has no effect in create mode.
93
94       -U     Don't show unverified files (default)
95
96       -zz    Force making/reading checksum files as gzipped  files,  even  if
97              not ending in .gz (mainly useful for "-f -")
98
99       -z     Make gzipped files in create mode.
100
101       -Z     Don't create gzipped files automatically. (default)
102
103       -ZZ    Never use gzip, even if file ends in ".gz".
104
105       --unquote BOOL
106              If  yes,  handle  checksum  files  that  were generated by buggy
107              encoders that quote filenames in  checksum  formats  that  don't
108              need  it.   Default is no, since quotes can be a valid character
109              in a filename and we don't want to remove them if they are actu‐
110              ally part of the filename.
111
112       --fixpaths string
113              Convert  all  occurances  of any characters in string to the dir
114              seperator for the current platform.  No effect in  create  mode.
115              Use an empty string to disable.
116
117       --strippaths VAL
118              Strip NUM leading components from file names in test mode.  Sim‐
119              ilar to the -p/--strip options of patch.   VAL  may  be  'none':
120              leave  exactly  as is, 'all': strip everything but the filename,
121              0: strip the leading driveletter/slash (if any), 1+: strip  this
122              many path components in addition.  The default is 0.
123
124       --showpaths VAL
125              Show  paths  in  displayed  filenames.   VAL  should  be  one of
126              yes/1/no/0/auto/2 or absolute/relative, or one from  first  list
127              and one from second joined by a -.  For backwards compatability,
128              1=yes, 0=none, 2=auto.  The default is auto-relative.  Abrievia‐
129              tions  are  accepted.   Examples:  --showpaths=y-a  always shows
130              absolute paths.  --showpaths=n never shows paths.
131
132       -p dir Change to directory before doing anything.
133
134       -f file
135              Specify the name of the checksum file to  test  or  create.   If
136              file is -, stdin (for -T) or stdout (for -C) will be used.
137
138       -t type
139              Specify  the  type  of the file.  Can be sfv, sfvmd5, csv, csv2,
140              csv4, sha1, md5, bsdmd5, par, par2, torrent, crc, auto, or help.
141              If  the type is help, or an unknown type is given, a list of the
142              types and their descriptions will be printed.   The  default  is
143              auto,  which  will detect the file type for you.  When creating,
144              if type is auto an sfv will be made, unless a different  default
145              has been set in the config file.
146
147       --list listset
148              Prints a raw listing of files in the given set (ok, bad, unveri‐
149              fied, notfound).  Usually used with -q, but not strictly  needed
150              since  specifying  --list  will  redirect  all other messages to
151              stderr.
152
153       --list0 listset
154              Like --list but files are seperated by a null char.   Useful  in
155              combination with xargs -0.
156
157       --announceurl URL
158              Tracker announce URL for .torrent file creation.
159
160       --piece_size_pow2 N
161              Power  of  two  to set piece size to for .torrent file creation.
162              The default is 18, which gives a piece size of 2^18=256KB.
163
164       -h/--help
165              Print help info.
166
167       --version
168              Print version of cfv and modules it uses.
169
170       sfv is a Simple File Verify format file
171       sfvmd5 is a Simple File Verify format file, using MD5 checksums  rather
172       than crc32.
173       csv   is   a   Comma  Seperated  Value  file,  with  the  fields  being
174       name,size,crc32,
175       csv2 is a Comma Seperated Value file, with the fields being name,size,
176       csv4  is  a  Comma  Seperated  Value  file,  with  the   fields   being
177       name,size,crc32,path
178       sha1 is a sha1sum format file
179       md5 is a md5sum format file
180       bsdmd5 is a BSD md5 format file
181       par is parchive v1 format file (test-only)
182       par2 is parchive v2 format file (test-only)
183       torrent is a BitTorrent metainfo file
184       crc is a JPEG Sheriff format crc file
185

EXIT STATUS

187       The  exit  status  of  cfv  can  be  examined to determine what kind of
188       errors, if any, occured.
189
190       An exit status of 1 indictates a command line  argument  error,  or  an
191       unhandled exception.
192
193       Otherwise, the exit status will be a bitwise OR of:
194
195       2      badcrc  (a  file  had  a  different  checksum than listed in the
196              checksum file)
197
198       4      badsize (a file had a different size than listed. Not all check‐
199              sum file formats include file size)
200
201       8      notfound (a file that was listed was not found)
202
203       16     ferror (some other file error occured when trying to open/read a
204              file)
205
206       32     unverified (a file was not verified, only with -u)
207
208       64     cferror (a checksum file was not found or not recognized)
209

NOTES

211       Since different platforms represent  the  path  seperator  differently,
212       using recursive mode 2 (-rr) is not recommended for anything other than
213       personal usage.  Although the addition of the fixpaths  option  can  be
214       used  to  work  around  this, it isn't guaranteed that whatever program
215       others user have will have a similar feature.
216
217       The -s option is not currently implemented for .torrent files.  (Unless
218       you also use -m)
219

EXAMPLES

221       If  no  options  are  specified, the default will be -T -t auto, and it
222       will search the current directory for any supported checksum files.
223       cfv
224
225       Force the file to test:
226       cfv -f funny.name
227
228       Test only the files you have, (avoid file not found errors):
229       cfv *
230
231       Create a csv file for all the files in the current dir:
232       cfv -C -tcsv
233
234       Create a csv file for only the zip files in the current dir, and  spec‐
235       ify the filename:
236       cfv -C -fsomezips.csv *.zip
237
238       Check  if all files in current and subdirs are verified, but don't ver‐
239       ify checksums of files that are.  (For example, before writing a direc‐
240       tory to a cdr and you want to make sure all the files are verified.):
241       cfv -r -m -u
242

CONFIGURATION

244       Upon startup, cfv will test for ~/.cfvrc and if it exists, read config‐
245       uration information from it.  The file consists of any number of lines,
246       each  having  a  single option name and the value seperated by a space.
247       Empty lines and lines beginning with a # are ignored.
248

EXAMPLE CONFIGURATION

250       #this is an example .cfvrc that specifies all the default options
251       #don't be verbose (set to 1 or v for -v, 0 or V for -V, -1  or  VV  for
252       -VV, -2 or q for -q, -3 or Q for -Q)
253       verbose V
254       #use  progress  meter  when output is to a terminal (yes for always, no
255       for never, auto for when output isatty)
256       progress auto
257       #create sfv files by default
258       default sfv
259       #sort dir listings before creating a checksum file
260       dirsort 1
261       #sort command line specified files
262       cmdlinesort 1
263       #expand wildcards in command line (yes for always, no for  never,  auto
264       for when os.name is os2, nt, or dos)
265       cmdlineglob auto
266       #don't be recursive (set to 0 for -R,  1 for -r,  2 for -rr)
267       recursive 0
268       #follow symbolic links
269       dereference 1
270       #don't show unverified files (set to 0 for -U, 1 for -u, 2 for -uu)
271       showunverified 0
272       #don't ignore case
273       ignorecase 0
274       #don't  use workaround for buggy encoders that quote filenames unneces‐
275       sarily
276       unquote 0
277       #don't fix any paths (note that there is a single space after fixpaths,
278       thus the value it gets set to is an empty string)
279       fixpaths
280       #A more useful example would be:
281       #fixpaths /\
282       #don't  strip  leading  directories  (all to strip all path info, 0+ to
283       strip the leading / and the first X components, none for nothing)
284       strippaths 0
285       #show full paths in recursive mode (set to 0 for never, 1 for always, 2
286       for only in recursive mode)
287       showpaths 2
288       #access  checksum  filenames that end with .gz as gzipped files (-1 for
289       never, 0 for with .gz, and 1 to make -C make .gz files automatically)
290       gzip 0
291       #don't rename bad files
292       rename 0
293       #format to use for renaming bad files with -n
294       renameformat %(name)s.bad-%(count)i%(ext)s
295       #don't search for files
296       search 0
297       #filename_type can be used to override what type of file to create when
298       -t isn't specified.
299       #The  format  of  the argument is <typename>=<regex>.  Can be specified
300       multiple times, the earlier instances having higher priority.
301       #for example, the following line would cause cfv -C -f foo.md5 to  cre‐
302       ate a 'sfvmd5' file rather than a 'md5' file.
303       #filename_type sfvmd5=md5$
304
305       #torrent options:
306       # you can specify a default announce url:
307       #announceurl http://foo.bar/announce
308       # piece size of 2^18 bytes (256KB):
309       piece_size_pow2 18
310

FILES

312       ~/.cfvrc
313              cfv configuration file.  See configuration section.
314
315       ~/_cfvrc
316              alternate configuration file name.  (Since windows won't let you
317              create files starting with a dot.)
318

ENVIRONMENT

320       HOME   Where to look for cfvrc file.  Note that win9x doesn't set  this
321              to anything automatically.
322
323       CFV_NOFCHKSUM
324              Set to a non-empty value to disable usage of python-fchksum mod‐
325              ule.
326
327       CFV_NOMMAP
328              Set to a non-empty value to disable usage of mmap.
329

AUTHOR

331       Matthew Mueller <donut AT dakotacom DOT net>
332
333       The latest version can be found at any of:
334       http://cfv.sourceforge.net/
335       http://www.dakotacom.net/~donut/programs/cfv.html
336       ftp://sunsite.unc.edu/pub/Linux/utils/file/
337
338       Other programs I have written can be found at:
339       http://www.dakotacom.net/~donut/programs/
340

SEE ALSO

342       md5sum(1), sha1sum(1), md5(1), xargs(1)
343
344
345
346                                  01 Feb 2005                           cfv(1)
Impressum