PXFSTAT(3F) Last changed: 1-6-98
PXFSTAT - Retrieves the file status
INTEGER jstat, ilen, ierror
CALL PXFSTAT(path, ilen, jstat, ierror)
UNICOS, UNICOS/mk, and IRIX systems
IEEE standard interface for FORTRAN 77
On IRIX systems, this routine is in libfortran.so which is linked by
default when compiling programs with the MIPSpro 7 Fortran 90 compiler
or when compiling programs with the -craylibs option to the MIPSpro
7.2 F77 compiler.
The PXFSTAT routine uses the stat system call to get the file status.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on
IRIX, the default kind is KIND=4.
The following is a list of arguments for this routine:
path An input character variable or array element containing the
name of a file.
ilen An input integer variable containing the length of path in
characters. If ilen is zero, all trailing blanks are removed
before calling stat().
jstat An input integer variable or array element containing a handle
for a stat structure. This handle should have been created by
a call to the PXFSTRUCTCREATE(3F) routine.
ierror An output integer variable that contains the status:
Zero PXFSTAT returned the status information.
Nonzero PXFSTAT was unable to return the status.
In addition to errors returned by the stat(2) system call, the
following errors may occur:
EINVAL If ilen < 0 or ilen > LEN(path).
ENOMEM If PXFSTAT is unable to obtain memory to copy path.
EBADHANDLE If jstat is an invalid handle or has an incorrect handle
type (UNICOS and UNICOS/mk systems only).
The stat structure contains the following components:
* st_mode: File mode.
* st_ino: File serial number.
* st_dev: ID of device containing the file.
* st_nlink: Number of links.
* st_uid: User id of the owner of the file.
* st_gid: Group id of the owner of the file.
* st_size: File size in bytes for regular files. Unspecified for
other files.
* st_atime: Last time that data within the file was accessed.
* st_mtime: Last time that data in the file was modified.
* st_ctime: Last time that file status was changed.
program test
character*10 path
integer ilen, jstat, ierr,imode, istino
path = 'stt.f'
call pxfstructcreate('stat',jstat,ierr)
print *,'structcreate error = ',ierr
ilen=0
call pxfstat(path, ilen, jstat, ierr)
if (ierr.ne.0) then
print *,'FAIL: error from pxfstat = ',ierr
else
print *,'PASS: No error from pxfstat = '
endif
call pxfintget(jstat,'st_ino',istino,ierr)
call pxfintget(jstat,'mode',imode,ierr)
print *,'st_ino = ',istino
print *,'mode = ',imode
call pxfstructfree(stat,ierr)
end
Application Programmer's Library Reference Manual, publication SR2165,
for the printed version of this man page.
PXFSTAT(3F) Last changed: 1-6-98
PXFSTAT - Retrieves the file status
INTEGER jstat, ilen, ierror
CALL PXFSTAT(path, ilen, jstat, ierror)
UNICOS, UNICOS/mk, and IRIX systems
IEEE standard interface for FORTRAN 77
On IRIX systems, this routine is in libfortran.so which is linked by
default when compiling programs with the MIPSpro 7 Fortran 90 compiler
or when compiling programs with the -craylibs option to the MIPSpro
7.2 F77 compiler.
The PXFSTAT routine uses the stat system call to get the file status.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on
IRIX, the default kind is KIND=4.
The following is a list of arguments for this routine:
path An input character variable or array element containing the
name of a file.
ilen An input integer variable containing the length of path in
characters. If ilen is zero, all trailing blanks are removed
before calling stat().
jstat An input integer variable or array element containing a handle
for a stat structure. This handle should have been created by
a call to the PXFSTRUCTCREATE(3F) routine.
ierror An output integer variable that contains the status:
Zero PXFSTAT returned the status information.
Nonzero PXFSTAT was unable to return the status.
In addition to errors returned by the stat(2) system call, the
following errors may occur:
EINVAL If ilen < 0 or ilen > LEN(path).
ENOMEM If PXFSTAT is unable to obtain memory to copy path.
EBADHANDLE If jstat is an invalid handle or has an incorrect handle
type (UNICOS and UNICOS/mk systems only).
The stat structure contains the following components:
* st_mode: File mode.
* st_ino: File serial number.
* st_dev: ID of device containing the file.
* st_nlink: Number of links.
* st_uid: User id of the owner of the file.
* st_gid: Group id of the owner of the file.
* st_size: File size in bytes for regular files. Unspecified for
other files.
* st_atime: Last time that data within the file was accessed.
* st_mtime: Last time that data in the file was modified.
* st_ctime: Last time that file status was changed.
program test
character*10 path
integer ilen, jstat, ierr,imode, istino
path = 'stt.f'
call pxfstructcreate('stat',jstat,ierr)
print *,'structcreate error = ',ierr
ilen=0
call pxfstat(path, ilen, jstat, ierr)
if (ierr.ne.0) then
print *,'FAIL: error from pxfstat = ',ierr
else
print *,'PASS: No error from pxfstat = '
endif
call pxfintget(jstat,'st_ino',istino,ierr)
call pxfintget(jstat,'mode',imode,ierr)
print *,'st_ino = ',istino
print *,'mode = ',imode
call pxfstructfree(stat,ierr)
end
Application Programmer's Library Reference Manual, publication SR2165,
for the printed version of this man page.
[ Back ]
|