home *** CD-ROM | disk | FTP | other *** search
- /* ==( bench/helpmisc.c )== */
- /* ----------------------------------------------- */
- /* Pro-C Copyright (C) 1988 - 1990 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written RN 15-Jan-90 */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- */
-
- # include <stdio.h>
- # include <bench.h>
- # include <fileio.h>
- # include <errno.h>
-
- # include "help.h"
-
- # ifdef ANSI
- long fsize(int);
- void stripext(char *);
- # else
- long fsize();
- void stripext();
- # endif
-
- long fsize(fd)
- int fd;
- {
- long file_length;
-
- file_length = lseek(fd, 0L, SEEK_END);
-
- return(file_length);
-
- /*
- struct stat sbuf;
-
- if (FSTAT(fd, &sbuf) == -1)
- {
- errmsg("fsize() : Error getting status on index file (%d)", errno);
- return(-1L);
- }
- return(sbuf.st_size);
- */
- }
-
- long file_time(path)
- char *path;
- {
- struct stat sbuf;
-
- if (STAT(path, &sbuf) == -1)
- {
- errmsg("fsize() : Error getting status on index file (%d)", errno);
- return(-1L);
- }
- return(sbuf.st_mtime);
- }
-