VMS Help  —  CRTL  utimes  Description
    The utimes function sets the access and modification times of the
    file pointed to by the path argument to the value of the times
    argument. The utimes function allows time specifications accurate
    to the microsecond.

    If the times argument is a NULL pointer, the access and
    modification times of the file are set to the current time. The
    effective user ID of the process must be the same as the owner
    of the file, or must have write access to the file or appropriate
    privileges to use this call in this manner.

    Upon completion, utimes marks the time of the last file status
    change, st_ctime, for update.

                     NOTE (Integrity servers, Alpha)

       On OpenVMS Alpha and Integrity server systems, the stat,
       fstat, utime, and utimes functions have been enhanced to
       take advantage of the new file-system support for POSIX
       compliant file timestamps.

       This support is available only on ODS-5 devices on OpenVMS
       Alpha systems beginning with a version of OpenVMS Alpha
       after Version 7.3.

       Before this change, the stat and fstat functions were
       setting the values of the st_ctime, st_mtime, and st_atime
       fields based on the following file attributes:

          st_ctime - ATR$C_CREDATE (file creation time)
          st_mtime - ATR$C_REVDATE (file revision time)
          st_atime - was always set to st_mtime because no support
          for file access time was available

       Also, for the file-modification time, utime and utimes were
       modifying the ATR$C_REVDATE file attribute, and ignoring the
       file-access-time argument.

       After the change, for a file on an ODS-5 device, the stat
       and fstat functions set the values of the st_ctime, st_
       mtime, and st_atime fields based on the following new file
       attributes:

          st_ctime - ATR$C_ATTDATE (last attribute modification
          time)
          st_mtime - ATR$C_MODDATE (last data modification time)
          st_atime - ATR$C_ACCDATE (last access time)

       If ATR$C_ACCDATE is 0, as on an ODS-2 device, the stat and
       fstat functions set st_atime to st_mtime.

       For the file-modification time, the utime and utimes
       functions modify both the ATR$C_REVDATE and ATR$C_MODDATE
       file attributes. For the file-access time, these functions
       modify the ATR$C_ACCDATE file attribute. Setting the ATR$C_
       MODDATE and ATR$C_ACCDATE file attributes on an ODS-2 device
       has no effect.

       For compatibility, the old behavior of stat, fstat, utime,
       and utimes remains the default, regardless of the kind of
       device.

       The new behavior must be explicitly enabled by defining the
       DECC$EFS_FILE_TIMESTAMPS logical name to "ENABLE" before
       invoking the application. Setting this logical does not
       affect the behavior of stat, fstat, utime, and utimes for
       files on an ODS-2 device.
Close Help