pxfopen
- Date:
10-20-2011
NAME
PXFOPEN - Provides a Fortran interface to the open system call
SYNOPSIS
INTEGER ilen, iopenflag, imode, ifildes, ierror
CHARACTER*n path
CALL PXFOPEN(path, ilen, iopenflag, imode, ifildes, ierror)
IMPLEMENTATION
Cray Linux Environment (CLE)
STANDARDS
IEEE Std 1003.9-1992 standard interface for FORTRAN 77
DESCRIPTION
The routine PXFOPEN provides a subset of the functionality of the open(2) system call.
The path argument identifies the file to be opened. If PXFOPEN successfully opens the file, the file descriptor is returned in the argument ifildes, and ierror is set to zero. If the file cannot be opened, ierror is set to the error value.
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 arguments for this routine:
- path
An input character variable or array element containing the name of the file to be opened.
- ilen
An input integer variable containing the length of path in characters. If ilen is zero, the trailing blanks are removed.
- iopenflag
An input integer variable containing the status flags. See the open(2) man page for more detail. The value for this variable may be obtained through the use of PXFCONST or IPXFCONST. The following values are currently supported for iopenflag:
O_RDONLY
O_WRONLY
O_RDWR
O_RAW
O_LDRAW
O_NDELAY
O_NONBLOCK
O_NOCTTY
O_BIG
O_APPEND
O_CREAT
O_TRUNC
O_EXCL
O_PLACE
O_RESTART
O_SSD
O_SYNC
O_WELLFORMED
The integer values may be combined through the use of a bitwise inclusive OR function.
- imode
An input integer variable, denoting the file access permission. The value for this variable may be retrieved through the use of PXFCONST or IPXFCONST. The following values are currently supported for imode:
- USER
READ permissions bit: S_IRUSR
WRITE permissions bit: S_IWUSR
SEARCH/EXECUTE permissions bit: S_IXUSR
Inclusive OR of READ/WRITE/EXECUTE: S_IRWXU
- GROUP
READ permissions bit: S_IRGRP
WRITE permissions bit: S_IWGRP
SEARCH/EXECUTE permissions bit: S_IXGRP
Inclusive OR of READ/WRITE/EXECUTE: S_IRWXG
- OTHER
READ permissions bit: S_IROTH
WRITE permissions bit: S_IWOTH
SEARCH/EXECUTE permissions bit: S_IXOTH
Inclusive OR of READ/WRITE/EXECUTE: S_IRWXO
- SETID
Set user ID on execution: S_ISUID
Set group ID on execution: S_ISGID
The integer values may be combined through the use of a bitwise inclusive OR function.
- ifildes
An output integer variable. If the open system call was successful, ifildes will be set to the file descriptor.
- ierror
An output integer variable containing the status:
- 0
If PXFOPEN was successful (the open(2) succeeded)
- errno
If the open(2) system call failed
- EINVAL
If ilen is less than 0 or ilen is greater than LEN(path)
NOTES
PXFOPEN does not provide a way to specify the cbits or cblks parameters to open(2).
SEE ALSO
open(2)