NAME
USAGE
ier = fnom(iun, fname, type, recl) (FORTRAN)
ier = c_fnom(iun, fname, type, recl) (C)
DESCRIPTION
Establish the connection between an external file name and a FORTRAN unit number to enable proper file opening. All files connected with fnom must be disconnected with fclos before the end of the program. Upon successful completion, fnom returns a value of 0. Upon failure a negative number will be returned.
(click the here for an example of use).
ARGUMENTS
FORTRAN unit number to be associated with the file.
Character string giving the external file name. If the file name contains the special character @ then it refers to a CMCARC file. The first part of the name (up to the @ character) is then recognized to be the actual file name and the second part of the name (after the @ character) refers to the sub-file name within the CMCARC file.
If the file name ends with ":" (column) and the type argument contains the attribute "remote" then the file is perceived to be remote and to reside on another computer. The remote attribute works only with "word adressable" (waread, wawrit) type of file as the RPN standard file and BURP files are. It then instructs the package to perform I/O with the use of UNIX sockets instead of conventional NFS. This feature could be useful for files that are not accessible via NFS.
Character string giving information on the file type. Two or many type attributes can be combined using a comma or a plus sign as the attributes separator. (see the example).
- 'STREAM' : BYTE STREAM file type (a la C).
- 'RND' : random type (word addressable, XDF, BURP, RPN standard file ...)
- 'FTN' : FORTRAN type ('SEQ' is implicit)
- 'FMT' : file to be read with FORMAT (FTN or D77 only)
- 'D77' : direct access file (in FORTRAN ANSI 77 sense). READ/WRITE(...,REC= ,...).
- 'STD' : RPN standard file
- 'SEQ' : sequential file (not necessarily FTN).
- 'OLD' : file must already exist.
- 'SCRATCH' : temporarily file. The name will be generated by fnom based on fname.
- ' APPEND' : file to be opened in append mode.
- 'R/W' : file to be opened in read/write mode.
- 'R/O' : file to be opened in read only mode.
- 'REMOTE' : remote file (file name must end with ':', all I/O will be performed using UNIX sockets)
Record length in words when type is D77. When type is not D77 recl should be 0.
AUTHOR
Mario Lépine - RPNNOTES
One can combine type attributes as shown below
+--------STREAM-------+ | | +---------RND---------+ | | +--FTN--+ +--FMT--+ | | | | | | +--D77--+--+-------+--+ +--APPEND--+ | | | | | +--RND--+ | +----OLD----+ +---R/W----+ | | | | | | | | >--+---STD----+--SEQ--+--+--+-----------+--+---R/O----+--+-----> | | | | +--FTN--+ +--SCRATCH-------------------+
SEE ALSO
( fclos)