1 /* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:34 hr Exp $
7 -- Provide our own utime function.
10 -- Dennis Vadura, dvadura@dmake.wticorp.com
13 -- http://dmake.wticorp.com/
16 -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
18 -- This program is NOT free software; you can redistribute it and/or
19 -- modify it under the terms of the Software License Agreement Provided
20 -- in the file <distribution-root>/readme/license.txt.
23 -- Use cvs log to obtain detailed change logs.
26 #include <sys/types.h>
36 struct timeval tv
[2], *tvp
;
43 tvp
= tv
, tv
[0].tv_sec
= timep
[0], tv
[1].tv_sec
= timep
[1];
44 if (utimes(name
, tvp
)==0)
48 if (stat(name
, &buf
) != 0)
50 if (buf
.st_size
!= 0) {
51 if ((fil
= open(name
, O_RDWR
, 0666)) < 0)
53 if (read(fil
, &data
, 1) < 1) {
58 if (write(fil
, &data
, 1) < 1) {
64 } else if ((fil
= creat(name
, 0666)) < 0) {