utimes.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 108 行

2
108
字号
.\" SCCSID: @(#)utimes.2	2.2	8/10/87.TH utimes 2.SH Nameutimes \- set file times.SH Syntax.nf#include <sys/time.h>.PPint utimes(\fIfile, tvp\fP)char *\fIfile\fP;struct timeval *\fItvp\fP;.fi.SH Description.NXR "utimes system call".NXR "file" "setting access time".NXR "file" "setting modification time"The.PN utimescallsets the access and modification times of the  filenamed by \fIfile\fP..PPIf.I tvpis NULL,the access and modification timesof the file are set to the current time.A process must be the owner of the file, the superuser,or have write permission to use.PN utimesin this manner..PPIf \fItvp\fP is not NULL, it is assumed to point to an array oftwo timeval structures.  The access time is set to the valueof the first member, and the modification time is set to thevalue  of  the second member.  Only the owner of the file orthe super-user may use .PN utimes in this manner..PPIn either case, the inode-changed time of the \fIfile\fP is set tothe current time..SH Return ValuesUpon successful completion, a value of zero (0) is returned.Otherwise, a value of \-1 is returned, and.I errno is set to indicate the error..SH DiagnosticsThe.PN utimessystem callfails if one or more of the following are true:.TP 20[EACCES]Search permission is denied for a component of the path prefix..TP 20[EACCES]The.I tvpargument is NULL and the caller is not the owner of the file;write access is denied..TP 20[EFAULT]The.I fileor.I tvppoints outside the process's allocated address space..TP 20[EINVAL]An illegal timeval (that is, negative seconds or microseconds greater than 999999) was supplied..TP 20[EIO]An I/O error occurred while reading or writing the affected inode..TP 20[ELOOP]Too many symbolic links were encountered in translating the pathname..TP 20[ENAMETOOLONG]A component of a pathname exceeds 255 characters, or an entirepathname exceeds 1023 characters..TP 20[ENOENT]The named file does not exist..TP 20[ENOTDIR]A component of the path prefix is not a directory..TP 20[EPERM]The.I tvpargument is not NULL, the caller has write access, the calleris not the owner of the file, and the caller is not the superuser..TP 20[EROFS]The file system containing the file is mounted read-only..TP[ETIMEDOUT]A connect request or remote file operation failed,because the connected partydid not respond after a periodof time determined by the communications protocol..SH See Alsostat(2)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?