1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)utimes.2 6.4 (Berkeley) 8/26/85
7 .TH UTIME 2 "August 26, 1985"
10 utime \- set file times
14 #include <sys/types.h>
17 int utime(const char *\fIfile\fP, struct utimbuf *\fItimes\fP)
24 \*(lqaccessed\*(rq and \*(lqupdated\*(rq times
25 from the utimbuf structure pointed to by
27 to set the corresponding recorded times for
30 Struct utimbuf is defined in <utime.h> as follows:
36 time_t actime; /* access time */
37 time_t modtime; /* modification time */
42 The caller must be the owner of the file or the super-user.
43 The \*(lqinode-changed\*(rq time of the file is set to the current time.
45 Upon successful completion, a value of 0 is returned.
46 Otherwise, a value of \-1 is returned and
48 is set to indicate the error.
51 will fail if one or more of the following are true:
54 A component of the path prefix is not a directory.
57 The pathname contains a character with the high-order bit set.
60 The path name exceeds PATH_MAX characters.
63 The named file does not exist.
66 Too many symbolic links were encountered in translating the pathname.
70 The process is not super-user and not the owner of the file.
73 Search permission is denied for a component of the path prefix.
76 The file system containing the file is mounted read-only.
80 or \fItimes\fP points outside the process's allocated address space.
83 An I/O error occurred while reading or writing the affected inode.