Files
oldlinux-files/Minix/2.0.0/wwwman/man2/utime.2.html
2024-02-19 00:21:39 -05:00

124 lines
2.5 KiB
HTML

<HTML>
<HEAD>
<TITLE>utime(2)</TITLE>
</HEAD>
<BODY>
<H1>utime(2)</H1>
<HR>
<PRE>
</PRE>
<H2>NAME</H2><PRE>
utime - set file times
</PRE>
<H2>SYNOPSIS</H2><PRE>
<STRONG>#include</STRONG> <STRONG>&lt;sys/types.h&gt;</STRONG>
<STRONG>#include</STRONG> <STRONG>&lt;utime.h&gt;</STRONG>
<STRONG>int</STRONG> <STRONG>utime(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>file</EM><STRONG>,</STRONG> <STRONG>struct</STRONG> <STRONG>utimbuf</STRONG> <STRONG>*</STRONG><EM>times</EM><STRONG>)</STRONG>
</PRE>
<H2>DESCRIPTION</H2><PRE>
The <STRONG>utime</STRONG> call uses the "accessed" and "updated" times from the utimbuf
structure pointed to by <EM>times</EM> to set the corresponding recorded times for
<EM>file</EM>.
Struct utimbuf is defined in &lt;utime.h&gt; as follows:
struct utimbuf {
time_t actime; /* access time */
time_t modtime; /* modification time */
};
The caller must be the owner of the file or the super-user. The "inode-
changed" time of the file is set to the current time.
</PRE>
<H2>RETURN VALUE</H2><PRE>
Upon successful completion, a value of 0 is returned. Otherwise, a value
of -1 is returned and <STRONG>errno</STRONG> is set to indicate the error.
</PRE>
<H2>ERRORS</H2><PRE>
<STRONG>Utime</STRONG> will fail if one or more of the following are true:
[ENOTDIR] A component of the path prefix is not a directory.
[EINVAL] The pathname contains a character with the high-order bit
set.
[ENAMETOOLONG] The path name exceeds PATH_MAX characters.
[ENOENT] The named file does not exist.
[ELOOP] Too many symbolic links were encountered in translating
the pathname. (Minix-vmd)
[EPERM] The process is not super-user and not the owner of the
file.
[EACCES] Search permission is denied for a component of the path
prefix.
[EROFS] The file system containing the file is mounted read-only.
[EFAULT] <EM>File</EM> or <EM>times</EM> points outside the process's allocated
address space.
[EIO] An I/O error occurred while reading or writing the
affected inode.
</PRE>
<H2>SEE ALSO</H2><PRE>
<STRONG><A HREF="../man2/stat.2.html">stat(2)</A></STRONG>.
</PRE>
</BODY>
</HTML>