pxfutime

Date:

10-20-2011

NAME

PXFUTIME - Sets access and modification times of a file

SYNOPSIS

CHARACTER*n path
INTEGER ilen, jutimbuf, ierror
CALL PXFUTIME(path, ilen, jutimbuf, ierror)

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

IEEE Std 1003.9-1992 standard interface for FORTRAN 77

DESCRIPTION

The routine PXFUTIME provides the functionality of the utime(2) system call.

All arguments must be of default kind unless documented otherwise. Default kind is KIND=4 for integer, real, complex, and logical arguments.

The following is a list of valid arguments for this routine:

path

An input character variable or array element containing the name of the file.

ilen

An input integer variable containing the length of path in characters. If ilen is zero, all trailing blanks are removed before calling utime.

jutimbuf

An input integer variable. It is a handle for a structure of type utimbuf. The handle must be created by a call to the PXFSTRUCTCREATE(3F) routine prior to the call to PXFUTIME. The names of the components of the utimbuf structure are actime and modtime. These components can be accessed through the PXFINTSET subroutine. The functionality obtained in utime by passing a NULL can be obtained in PXFUTIME by passing a handle argument with a value of zero.

ierror

An output integer variable that contains zero if the call to utime was successful or nonzero if the call to utime was not completed.

In addition to the errors returned by the utime(2) system call, PXFUTIME may return the following errors:

EINVAL

If ilen is less than 0 or ilen is greater than LEN(path).

ENOMEM

If PXFUTIME is unable to obtain memory to copy path.

EXAMPLES

      program test
      character*12 filea, fileb
      integer ilenfila, ilenfilb, jutimbuf, ierror

! create file
      open(file='existfile', unit=9, status='NEW')
      write(9,*) 'HI', 1.2, 11, 'GOODBYE'
      endfile 9
      close 9
      filea = 'existfile'
      ilenfila = 0
      ilenfilb = 0

! Set file access and modification time to current time
      call pxfutime(filea,ilenfila,0,ierror)
      if (ierror.ne.0) then
         print *,'FAIL: pxfutime'
         print *,'nonzero status on existing file = ',ierror
      else
         print *,'PASS: pxfutime'
         print *,'zero status on existing file'
      endif

      end

SEE ALSO

utime(2)