utimes
Purpose
Sets file times.
Library
Berkeley Library (libbsd.a)
Syntax
#include <bsd/sys/time.h>
int utimes (file, tvp)
char *file;
struct timeval tvp[2|;
Description
The utimes subroutine sets the accessed and updated times
of a file to the values specified by the tvp parameter.
The inode-changed time of the file is set to the current
time.
The calling process must be the owner of the file or have
an effective user ID of superuser.
Note: In the AIX Operating System, file times have a
resolution of 1 second.
Return Value
When the call succeeds, a value of 0 is returned. If
utimes fails, a value of -1 is returned and errno is set
to indicate the error.
Diagnostics
The utimes subroutine fails if one or more of the fol-
lowing is true:
EACCES Search permission is denied to a component of
the path prefix.
EFAULT The file or tvp parameter &pointsout..
ENOENT The named file does not exist.
ENOTDIR A component of the path prefix is not a direc-
tory.
EPERM The calling process is not the owner of the
file and does not have an effective user ID of
superuser.
EROFS The file system that contains the file is
mounted read-only.
Related Information
In this book: "stat, fstat."