Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: impossible problem for find(1)? Message-ID: <5797@brl-smoke.ARPA> Date: Sat, 25-Apr-87 20:09:41 EDT Article-I.D.: brl-smok.5797 Posted: Sat Apr 25 20:09:41 1987 Date-Received: Sun, 26-Apr-87 22:14:56 EDT References: <2645@phri.UUCP> <6454@mimsy.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 48 In article <6454@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >If you have the `newer' program, ... /* newer -- test file modification dates last edit: 86/03/30 D A Gwyn */ #ifndef lint static char SCCS_ID[] = "@(#)newer.c 1.1"; #endif #include #include #define EXIT _exit /* non-STDIO exit(), if available */ #define STDERR 2 /* standard error file descriptor */ extern void EXIT(); extern int stat(), write(); main( argc, argv ) int argc; char *argv[]; { static char usage[] = "Usage: newer file1 file2\n"; static struct stat file1; /* file1 statistics */ static struct stat file2; /* file2 statistics */ if ( argc != 3 ) { /* wrong number of arguments */ (void)write( STDERR, usage, sizeof usage - 1 ); EXIT( 3 ); } if ( stat( argv[1], &file1 ) != 0 ) EXIT( 2 ); /* file1 doesn't exist */ if ( stat( argv[2], &file2 ) != 0 ) EXIT( 0 ); /* file2 doesn't exist */ #ifdef lint return file1.st_mtime < file2.st_mtime ? 1 : 0; #else EXIT( file1.st_mtime < file2.st_mtime ? 1 : 0 ); #endif }