Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ utime(2) — Ultrix-11 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(2)

utime(2)

NAME

utime − set file times

SYNTAX

#include <sys/types.h>

int utime(file, times)
char *file;
struct utimbuf ∗times;

DESCRIPTION

The utime system call uses the accessed and updated times, in that order, from the timep vector to set the corresponding recorded times for file. 

If times is NULL, the access and modification times of the file are set to the current time.  A process either must be the owner of the file or must have write permission to use utime in this manner. 

If times is not NULL, times is interpreted as a pointer to a utimbuf structure and, the access and modification times are set to the values contained in the designated structure.  Only the owner of the file or the superuser may use utime this way. 

The times in the following structure are measured in seconds since 00:00:00 GMT, Jan. 1, 1970. 

struct  utimbuf {
        time_t  actime;      /∗ access time ∗/
        time_t  modtime;     /∗ modification time ∗/
};

The caller must be the owner of the file or the superuser. The “inode-changed” time of the file is set to the current time.

DIAGNOSTICS

The utime call will fail if:

[EACCES] A component of the path prefix denies search permission. 

[EFAULT] The specified timep points to an address outside the process’s allocated address space. 

[ENFILE] There is insufficient system space to contain inode. 

[ENOENT] Either named file or an element within the named file does not exist. 

[ENOTDIR] A component of the path prefix is not a directory. 

[EPERM] The process’s effective user ID is not the superuser and not the same as the owner of the file. 

[EROFS] The named file is located on a read-only file system. 

ASSEMBLER

(utime = 30.) 
sys utime; file; timep

SEE ALSO

stat(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026