BSD 4_4 development
[unix-history] / usr / share / man / cat2 / utimes.0
UTIMES(2) BSD Programmer's Manual UTIMES(2)
N\bNA\bAM\bME\bE
u\but\bti\bim\bme\bes\bs - set file access and modification times
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bsy\bys\bs/\b/t\bti\bim\bme\be.\b.h\bh>\b>
_\bi_\bn_\bt
u\but\bti\bim\bme\bes\bs(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bi_\bl_\be, _\bc_\bo_\bn_\bs_\bt _\bs_\bt_\br_\bu_\bc_\bt _\bt_\bi_\bm_\be_\bv_\ba_\bl _\b*_\bt_\bi_\bm_\be_\bs);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The u\but\bti\bim\bme\bes\bs() function sets the access and modification times of the named
file from the structures in the argument array _\bt_\bi_\bm_\be_\bs.
The first structure is the access time, and the second is the modifica-
tion time.
If the times are specified (the _\bt_\bi_\bm_\be_\bs argument is non-NULL) the caller
must be the owner of the file or be the super-user.
If the times are not specified (the _\bt_\bi_\bm_\be_\bs argument is NULL) the caller
must be the owner of the file, have permission to write the file, or be
the super-user.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bES\bS
Upon successful completion, a value of 0 is returned. Otherwise, a value
of -1 is returned and _\be_\br_\br_\bn_\bo is set to indicate the error.
E\bER\bRR\bRO\bOR\bRS\bS
U\bUt\bti\bim\bme\bes\bs() will fail if:
[EACCES] Search permission is denied for a component of the path
prefix; or the _\bt_\bi_\bm_\be_\bs argument is NULL and the effective us-
er ID of the process does not match the owner of the file,
and is not the super-user, and write access is denied.
[EFAULT] File or _\bt_\bi_\bm_\be_\bs points outside the process's allocated ad-
dress space.
[EINVAL] The pathname contains a character with the high-order bit
set.
[EIO] An I/O error occurred while reading or writing the affected
inode.
[ELOOP] Too many symbolic links were encountered in translating the
pathname.
[ENAMETOOLONG]
A component of a pathname exceeded 255 characters, or an
entire path name exceeded 1023 characters.
[ENOENT] The named file does not exist.
[ENOTDIR] A component of the path prefix is not a directory.
[EPERM] The _\bt_\bi_\bm_\be_\bs argument is not NULL and the calling process's
effective user ID does not match the owner of the file and
is not the super-user.
[EROFS] The file system containing the file is mounted read-only.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
stat(2)
H\bHI\bIS\bST\bTO\bOR\bRY\bY
The u\but\bti\bim\bme\bes\bs function call appeared in 4.2BSD.
4th Berkeley Distribution June 4, 1993 2