I would find it more accurate to report 'fopen FAILED' rather than expect that all failures to open a file are a result of a missing file.
Penned by Stuart Henderson on 20110408 4:23.44, we have: | would anyone else find this (or a variation thereof) useful? | | example use: if you download a partial snapshot and would like to | check files, this makes it easy to identify whether a file actually | fails the checksum, or whether you just don't have it. | | Index: md5.c | =================================================================== | RCS file: /cvs/src/bin/md5/md5.c,v | retrieving revision 1.52 | diff -u -p -r1.52 md5.c | --- md5.c 27 Oct 2010 15:24:10 -0000 1.52 | +++ md5.c 8 Apr 2011 09:17:29 -0000 | @@ -655,7 +655,7 @@ digest_filelist(const char *file, struct | | if ((fp = fopen(filename, "r")) == NULL) { | warn("cannot open %s", filename); | - (void)printf("(%s) %s: FAILED\n", algorithm, filename); | + (void)printf("(%s) %s: MISSING\n", algorithm, filename); | error = 1; | continue; | } -- Todd Fries .. t...@fries.net _____________________________________________ | \ 1.636.410.0632 (voice) | Free Daemon Consulting, LLC \ 1.405.227.9094 (voice) | http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX) | 2525 NW Expy #525, Oklahoma City, OK 73112 \ sip:freedae...@ekiga.net | "..in support of free software solutions." \ sip:4052279...@ekiga.net \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A http://todd.fries.net/pgp.txt