utime.3
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 117 行
3
117 行
.\" SCCSID: @(#)utime.3 2.1 3/10/87.TH utime 3.SH Nameutime \- set file times.SH Syntax.nf.B #include <sys/types.h>.B int utime (\fIpath, times\fP).B char *\fIpath\fP;.B struct utimbuf *\fItimes\fP;.fi.SH Description.NXR "utime function".NXR "file" "setting access time".NXR "file" "setting modification time"The.I pathpoints to a pathname naming a file. The.PN utimefunctionsets the access and modification timesof the named file..PPIf.I timesis NULL,the access and modification timesof the file are set to the current time.A process must be the owner of the fileor have write permission to use.PN utimein this manner..PPIf.I timesis not NULL,.I timesis interpreted as a pointer to a.I utimbufstructure andthe access and modification timesare set to the values contained inthe designated structure. Only theowner of the file or the super-user can use.PN utimethis way..PPThe function.PN utimecauses the time of the last file status change(st_ctime) to be updated with the current time..PPThe times in the following structureare measured in seconds since 00:00:00GMT\*S,January 1, 1970..EX 0struct utimbuf { time_t actime; /* access time */ time_t modtime; /* modification time */};.EE.SH Return ValuesUpon successful completion, a value of zero (0) is returned. Otherwise, a value of \-1 is returned, and .I errnois set to indicate the error..SH DiagnosticsThe.PN utimefunction fails, if any of the following is true:.TP 15[EACCES]Search permission is denied by a component of the.I pathprefix..TP 15[EACCES]The effective user ID is not super-user, not the owner of the file,.I timesis NULL, and write access is denied..TP 15[EFAULT]The.I timesis not NULL and points outside the process's allocated address space..TP 15[EFAULT]The.I pathpoints outside the process's allocated address space..TP 15[ENOENT]The named file does not exist or.I pathpoints to an empty string and the environment defined is POSIX or SYSTEM_FIVE..TP 15[ENOTDIR]A component of the.I pathprefix is not a directory..TP 15[EPERM]The effective user ID is not a super-user, not the owner of the file, and.I timesis not NULL..TP 15[EROFS]The file system containing the file is mounted read-only..TP 15[ETIMEDOUT]A connect request or remote file operation failed, because the connected partydid not respond after a period of time determined by the communicationsprotocol..SH See Alsostat(2)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?