home *** CD-ROM | disk | FTP | other *** search
- #include "local.h"
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <time.h>
- #ifndef sun386
- #include <utime.h>
- #endif
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/ioctl.h>
- #include <sys/time.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #include <signal.h>
- #include <errno.h>
- #include <sys/file.h>
- #include <sys/stat.h>
- #include <sys/param.h>
- #include <sys/mount.h>
- #include <pwd.h>
- #ifdef __STDC__
- #include <stdarg.h>
- #else
- #include <varargs.h>
- #endif
- #include <unistd.h>
- #include <sys/wait.h>
- #ifdef ISC
- #include <sys/stream.h>
- #endif
- #include <net/if.h>
-
- /****************************************************************************
- set the time on a file
- ****************************************************************************/
- int set_filetime(char *fname,time_t mtime)
- {
- struct utimbuf times;
-
- times.modtime = times.actime = mtime;
-
- return(utime(fname,×) == 0);
- }
-
- /****************************************************************************
- get the time on a file
- ****************************************************************************/
- int get_filetime(char *fname)
- {
- struct stat st;
- if (stat(fname,&st) != 0)
- return(0);
-
- return(st.st_mtime);
- }
-
-
- main()
- {
- set_filetime("timetest.c",100000);
- printf("%d\n",get_filetime("timetest.c"));
- }
-