.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.man%
.\" @(#)utimes.2 8.1 (Berkeley) %G%
.Nd set file access and modification times
.Fd #include <sys/time.h>
.Fn utimes "const char *file" "const struct timeval *times"
function sets the access and modification times of the named file from
the structures in the argument array
The first structure is the access time, and the second is the modification
If the times are specified (the
the caller must be the owner of the file or be the super-user.
If the times are not specified (the
the caller must be the owner of the file, have permission to
write the file, or be the super-user.
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and
is set to indicate the error.
Search permission is denied for a component of the path prefix;
and the effective user ID of the process does not
match the owner of the file, and is not the super-user, and write
points outside the process's allocated address space.
The pathname contains a character with the high-order bit set.
An I/O error occurred while reading or writing the affected inode.
Too many symbolic links were encountered in translating the pathname.
A component of a pathname exceeded 255 characters,
or an entire path name exceeded 1023 characters.
The named file does not exist.
A component of the path prefix is not a directory.
and the calling process's effective user ID
does not match the owner of the file and is not the super-user.
The file system containing the file is mounted read-only.
function call appeared in