Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ utime(2) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

touch(1)

lstat(2)

stat(2)

ustat(2)

utimes(2)

stat(5)

sde(5)



utime(2)                          SDK R4.11                         utime(2)


NAME
       utime - set file access and modification times

SYNOPSIS
       #include <sys/types.h>
       #include <utime.h>

       int  utime (path, times)
       const char * path;
       const struct utimbuf *times;

   where:
       path      Address of a pathname

       times     NULL or address of an initialized structure giving the
                 access and modification times

DESCRIPTION
       Path points to a pathname naming a file, which must reside on a file
       system device mounted read-write.  If path refers to a symbolic link,
       the target of the symbolic link is affected.  Utime sets the `time-
       last-accessed' and `time-last-modified' attributes of the subject
       file.

       Two versions of utime are provided, to accommodate the differences in
       the System V and 88open specifications.  The 88open version of utime,
       which provides microsecond granularity in the utimbuf structure, is
       selected unconditionally for 88K COFF-based software development
       environments (see sde(5)), and for other environments when the
       USECUTIMEFLAVOR macro is defined.  The System V version, which
       provides only second granularity, is selected otherwise.  Note that
       DG/UX revisions prior to R4.10 provided only the 88open version.

       If times is NULL, `time-last-accessed' and `time-last-modified' are
       set to the current time.  Otherwise, the `time-last-accessed' is set
       according to (*times).actime and (for the 88open version only)
       (*times).acusec, and `time-last-modified' is set according to
       (*times).modtime and (for the 88open version only) (*times).modusec.
       The actime and modtime members, with type timet defined in
       <sys/types.h>, express seconds since 00:00:00 GMT, January 1, 1970.
       The acusec and modusec members, present only for the 88open version
       of utime, express microseconds since their respective seconds, in the
       range 0 to 999,999, inclusive.

       If utime fails, the file is left unchanged.  Otherwise, the `time-
       last-changed' attribute of the subject file is set to the current
       time.

ACCESS CONTROL
       The calling process must have permission to resolve path.

       If times is NULL, either the calling process must have write
       permission to the subject file or the calling process must have
       appropriate privilege.

       On a generic DG/UX system, the caller has appropriate privilege when
       its effective user id is equal to the user id of the subject file.
       See the appropriateprivilege(5) man page for more information.

       For systems supporting the DG/UX Capability Option, the caller has
       appropriate privilege when it has one or more specific capabilities
       enabled in its effective capability set.  See capdefaults(5) for the
       default capability for this system call.

RETURN VALUE
       0      The file's access and modification times were changed
              successfully.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       EACCES         Permission to set the access and modification times to
                      the current time is denied to the calling process.

       EFAULT         Times is not NULL and some part of the utimbuf
                      structure pointed to by times lies outside the
                      process's readable address space.

       EPERM          Permission to set the access and modification times to
                      an arbitrary value is denied to the calling process.

       EROFS          The file system device containing the subject file is
                      mounted read-only.

       ENOENT         The file the pathname resolved to does not exist.

       ENOENT         A non-terminal component of the pathname does not
                      exist.

       ENOTDIR        A non-terminal component of the pathname was not a
                      directory or symbolic link.

       ENAMETOOLONG   The pathname exceeds the length limit for pathnames.

       ENAMETOOLONG   A component of the pathname exceeds the length limit
                      for filenames.

       ENOMEM         There are not enough system resources to resolve the
                      pathname or to expand a symbolic link.

       ELOOP          The number of symbolic links encountered during
                      pathname resolution exceeded MAXSYMLINKS.  A symbolic
                      link cycle is suspected.

       EPERM          The pathname contains a character not in the allowed
                      character set.

SEE ALSO
       touch(1), dgmstat(2), lstat(2), stat(2), ustat(2), utimes(2),
       capdefaults(5), stat(5), sde(5).


Licensed material--property of copyright holder(s)

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