1UTIMES(P)                  POSIX Programmer's Manual                 UTIMES(P)
2
3
4

NAME

6       utimes - set file access and modification times (LEGACY)
7

SYNOPSIS

9       #include <sys/time.h>
10
11       int utimes(const char *path, const struct timeval times[2]);
12
13

DESCRIPTION

15       The  utimes()  function  shall set the access and modification times of
16       the file pointed to by the path argument to  the  value  of  the  times
17       argument.  The utimes() function allows time specifications accurate to
18       the microsecond.
19
20       For utimes(), the times argument is an array of timeval structures. The
21       first array member represents the date and time of last access, and the
22       second member represents the date and time of  last  modification.  The
23       times in the timeval structure are measured in seconds and microseconds
24       since the Epoch, although rounding toward the nearest second may occur.
25
26       If the times argument is a null pointer, the  access  and  modification
27       times of the file shall be set to the current time.  The effective user
28       ID of the process shall match the owner  of  the  file,  or  has  write
29       access  to  the file or appropriate privileges to use this call in this
30       manner. Upon completion, utimes() shall mark the time of the last  file
31       status change, st_ctime, for update.
32

RETURN VALUE

34       Upon successful completion, 0 shall be returned. Otherwise, -1 shall be
35       returned and errno shall be set to indicate the  error,  and  the  file
36       times shall not be affected.
37

ERRORS

39       The utimes() function shall fail if:
40
41       EACCES Search  permission  is denied by a component of the path prefix;
42              or the times argument is a null pointer and the  effective  user
43              ID of the process does not match the owner of the file and write
44              access is denied.
45
46       ELOOP  A loop exists in symbolic links encountered during resolution of
47              the path argument.
48
49       ENAMETOOLONG
50              The length of the path argument exceeds {PATH_MAX} or a pathname
51              component is longer than {NAME_MAX}.
52
53       ENOENT A component of path does not name an existing file or path is an
54              empty string.
55
56       ENOTDIR
57              A component of the path prefix is not a directory.
58
59       EPERM  The  times  argument  is  not  a  null  pointer  and the calling
60              process' effective user ID has write access to the file but does
61              not match the owner of the file and the calling process does not
62              have the appropriate privileges.
63
64       EROFS  The file system containing the file is read-only.
65
66
67       The utimes() function may fail if:
68
69       ELOOP  More than {SYMLOOP_MAX} symbolic links were  encountered  during
70              resolution of the path argument.
71
72       ENAMETOOLONG
73              Pathname  resolution of a symbolic link produced an intermediate
74              result whose length exceeds {PATH_MAX}.
75
76
77       The following sections are informative.
78

EXAMPLES

80       None.
81

APPLICATION USAGE

83       For applications portability, the utime() function should  be  used  to
84       set file access and modification times instead of utimes().
85

RATIONALE

87       None.
88

FUTURE DIRECTIONS

90       This function may be withdrawn in a future version.
91

SEE ALSO

93       utime()   ,   the  Base  Definitions  volume  of  IEEE Std 1003.1-2001,
94       <sys/time.h>
95
97       Portions of this text are reprinted and reproduced in  electronic  form
98       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
99       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
100       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
101       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
102       event of any discrepancy between this version and the original IEEE and
103       The Open Group Standard, the original IEEE and The Open Group  Standard
104       is  the  referee document. The original Standard can be obtained online
105       at http://www.opengroup.org/unix/online.html .
106
107
108
109IEEE/The Open Group                  2003                            UTIMES(P)
Impressum