ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fdate.c
Revision: 2.6
Committed: Tue Feb 25 02:47:21 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 2.5: +1 -56 lines
Log Message:
Replaced inline copyright notice with #include "copyright.h"

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id$";
3 #endif
4 /*
5 * Return file date (UNIX seconds as returned by time(2) call)
6 *
7 * External symbols declared in standard.h
8 */
9
10 #include "copyright.h"
11
12 #include <sys/types.h>
13 #include <sys/stat.h>
14
15
16 time_t
17 fdate(fname) /* get file date */
18 char *fname;
19 {
20 struct stat sbuf;
21
22 if (stat(fname, &sbuf) == -1)
23 return(0);
24
25 return(sbuf.st_mtime);
26 }
27
28
29 int
30 setfdate(fname, ftim) /* set file date */
31 char *fname;
32 long ftim;
33 {
34 time_t ftm[2];
35
36 ftm[0] = ftm[1] = ftim;
37
38 return(utime(fname, ftm));
39 }