01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

,�<br />

UTIME(2) UTIME (2)<br />

NAME<br />

utime - set file access and modification times<br />

SYNOPSIS<br />

#include <br />

int utime (path , times)<br />

char *path;<br />

struct utimbuf •times;<br />

DESCRIPTION<br />

Path points to a path name naming a file. Utime sets the access<br />

and modification times of the named file.<br />

If times is NULL, the access and modification times of the file are<br />

set to the current time. A process must be the owner of the file or<br />

have write permission to use utime in this manner.<br />

If times is not NULL, times is interpreted as a pointer to a utimbuf<br />

structure and the access and modification times are set to the<br />

values contained in the designated structure. Only the owner of<br />

the file or the super-user may use utime this way.<br />

The times in the following structure are measured in seconds since<br />

00:00:00 GMT, Jan. 1, 1970.<br />

struct utimbuf {<br />

time_t actime; I* access time *I<br />

time_t modtime; I* modification time *I<br />

};<br />

Utime will fail if one or more of the following are true:<br />

The named file does not exist. [ENOENT]<br />

A component of the path prefix is not a directory.<br />

[ENOTDffi]<br />

Search permission is denied by a component of the path<br />

prefix. [EACCES]<br />

The effective user ID is not super-user and not the owner<br />

of the file and times is not NULL. [EPERM]<br />

The effective user ID is not super-user and not the owner<br />

of the file and times is NULL and write access is denied.<br />

[EACCES]<br />

The file system containing the file is mounted read-only.<br />

[EROFS]<br />

Times is not NULL and points outside the process's allocated<br />

address space. [EFAULT]<br />

Path points outside the process's allocated address space.<br />

[EFAULT]<br />

RETURN VALUE<br />

Upon successful completion, a value of 0 is returned. Otherwise, a<br />

value of -1 is returned and errno is set to indicate the error.<br />

SEE ALSO<br />

stat(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!