--- ray/src/common/fdate.c 1993/11/22 09:31:59 2.3 +++ ray/src/common/fdate.c 2003/06/27 06:53:21 2.8 @@ -1,15 +1,21 @@ -/* Copyright (c) 1993 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: fdate.c,v 2.8 2003/06/27 06:53:21 greg Exp $"; #endif - /* * Return file date (UNIX seconds as returned by time(2) call) + * + * External symbols declared in rtio.h */ -#include +#include "copyright.h" + +#include "rtio.h" #include +#ifdef _WIN32 + #include +#else + #include +#endif time_t @@ -22,4 +28,23 @@ char *fname; return(0); return(sbuf.st_mtime); +} + + +int +setfdate(fname, ftim) /* set file date */ +char *fname; +long ftim; +{ + struct utimbuf utb; + + utb.actime = utb.modtime = ftim; + return(utime(fname, &utb)); + +#ifdef NOTHING /* XXX does this work anywhere? */ + time_t ftm[2]; + + ftm[0] = ftm[1] = ftim; + return(utime(fname, ftm)); +#endif }