Thread View: mod.std.unix
2 messages
2 total messages
Started by Moderator, John Quarterman
Tue, 04 Nov 1986 01:34
public-domain implementation of V8 "newer"
Author: Moderator, John Quarterman
Date: Tue, 04 Nov 1986 01:34
Date: Tue, 04 Nov 1986 01:34
50 lines
1682 bytes
1682 bytes
From: gwyn@brl.arpa (VLD/VMB) (Douglas A. Gwyn)
Date: Mon, 3 Nov 86 10:37:13 EST
/*
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 <sys/types.h>
#include <sys/stat.h>
#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
}
Volume-Number: Volume 8, Number 29
Re: public-domain implementation of V8 "newer"
Author: Moderator, John Quarterman
Date: Wed, 05 Nov 1986 22:12
Date: Wed, 05 Nov 1986 22:12
14 lines
1007 bytes
1007 bytes
From: harvard!ho3cad!ekb (Eric Bustad) Date: Wed, 5 Nov 86 15:40:42 CST This version of "newer" will say that one file is newer that the other when they are both exactly the same age. Is this a bug or does the V8 version of "newer" act this way also? = Eric Bustad AT&T Bell Laboratories Holmdel NJ 07733-1988 (201)949-6257 ekb@ho3cad.ATT.COM or ihnp4!ho3cad!ekb Volume-Number: Volume 8, Number 44
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads