2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
15 /*****************************************************************************
23 struct timeval tvp
[2])
26 Change last access and last modification time of the given file to
27 times specified in tvp array. If tvp is NULL, the current time will be
31 filename - Name of the file
32 buf - Pointer to an array of two timeval structures. First structure
33 specifies the last access time, second specifies the last
37 0 on success and -1 on error. If an error occurred, the global
38 variable errno is set.
41 The timeval structure has microsecond resolution, but in reality
42 this function has time resolution of 1 tick.
47 Since AROS has no notion of last access time, it's silently ignored
48 and only modification time of the file is set.
55 ******************************************************************************/
59 if (!file
) /*safety check */
65 file
= __path_u2a(file
);
71 ULONG t
= (ULONG
)tvp
[1].tv_sec
- 2922 * 1440 * 60;
73 ds
.ds_Days
= t
/ (60*60*24);
74 ds
.ds_Minute
= (t
/ 60) % (60*24);
75 ds
.ds_Tick
= (t
% 60) * TICKS_PER_SECOND
;
80 if (SetFileDate(file
, &ds
))
83 errno
= IoErr2errno(IoErr());