home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume25 / finger / part01 / symdate.c < prev    next >
C/C++ Source or Header  |  1992-04-03  |  947b  |  46 lines

  1. /*
  2.  * symdate.c -- stand alone prog to write symdate.h
  3.  *
  4.  * Copyright (C) 1986, 1990  Philip L. Budne
  5.  *
  6.  * This file is part of "Phil's Finger Program".
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 1, or (at your option)
  11.  * any later version.
  12.  *
  13.  */
  14.  
  15. # ifndef lint
  16. static char *rcsid = "$Id: symdate.c,v 3.0 90/07/06 13:11:52 budd Rel $";
  17. # endif /* lint not defined */
  18.  
  19. # include <stdio.h>
  20. # include <sys/types.h>
  21. # include <sys/stat.h>
  22. # include "finger.h"
  23.  
  24. main(argc, argv)
  25. int argc;
  26. char *argv[];
  27. {
  28.     struct stat stb;
  29.  
  30.     if( argc != 2 )
  31.     fprintf(stderr, "%s file\n", argv[0] );
  32.     else if( stat( argv[1], &stb ) < 0 )
  33.     perror( argv[1] );
  34.     else {
  35.     printf("%ld\n", stb.st_mtime );
  36.     exit( 0 );
  37.     }
  38.     exit( 1 );
  39. } /* main */
  40.  
  41. /*
  42.  * Local variables:
  43.  * comment-column: 40
  44.  * End:
  45.  */
  46.