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"
-
- char StatSizeErr_d[] = "fsize() : Error getting status on index file (%d)";
-
- PROTO (long fsize, (int));
- PROTO (void stripext, (char *));
-
- long fsize(fd)
- int fd;
- {
- long file_length, curpos;
-
- curpos = lseek(fd, 0L, SEEK_CUR);
-
- file_length = lseek(fd, 0L, SEEK_END);
-
- lseek(fd, curpos, SEEK_SET);
-
- return(file_length);
- }
-
- long file_time(path)
- char *path;
- {
- struct stat sbuf;
-
- if (STAT(path, &sbuf) == -1)
- {
- errmsg(StatSizeErr_d, errno);
- return(-1L);
- }
- return(sbuf.st_mtime);
- }
-