Intel fortran-80 manual BACKSPACE Statement, REWI N D Statement, File Disposition Specifier

Models: fortran-80

1 130
Download 130 pages 742 b
Page 69
Image 69
6.2.2.2 File Disposition Specifier

FORTRAN-80

Input/Output

6.2.2.2 File Disposition Specifier

The format of the file disposition specifier is

STATUS = stat

where 'stat' is a character expression evaluating to 'KEEP' or 'DELETE'. If this specifier is omitted, the default value is 'DELETE' for a file that previously had a status of 'SCRATCH', and 'KEEP' otherwise. Under no circumstances can 'KEEP' be specified for a file opened with 'SCRATCH' status.

If 'KEEP' is specified for an existing file, the file continues to exist after the CLOSE statement is executed. Otherwise, 'KEEP' has no effect.

If 'DELETE' is specified, the file ceases to exist after the CLOSE statement is ex- ecuted.

Following normal program termination, all connected units are closed. Scratch units are deleted; all others are closed with disposition 'KEEP'.

Example:

CLOSE (3, ERR = 1020, STATUS ='KEEP')

6.2.3 BACKSPACE Statement

The BACKSPACE statement causes the file connected to the specified unit to be positioned before the preceding record. Its possible formats are

BACKSPACE unit

BACKSPACE (arg-list)

where 'unit' is an external unit specifier and 'arg-list' is a list of arguments separated by commas. The list of arguments is:

[UNIT =] unit

External unit specifier

IOSTAT = stname

110 status specifier

ERR = stl

Error specifier

The argument list must include an external unit specifier (section 6.2.1.1) and may contain an 110 status specifier (section 6.2.1.2) and an error specifier (section 6.2.1.3). The file being backspaced must be connected for sequential access.

If the file has no preceding record, the BACKSPACE statement has no effect. If the end-of-file condition has occurred, the file is positioned such that the last record of the file becomes the preceding record.

Backspacing over a record written using list-directed formatting is not allowed. Backspacing a nonexistent file or unit is prohibited also.

Examples:

BACKSPACE 3

BACKSPACE (3, ERR = 1020)

6.2.4 REWI N D Statement

The REWIND statement causes the file connected to the specified unit to be reposi- tioned at its initial point. The file must be connected for sequential access. The possible formats for the REWIND statement are

REWIND unit

REWI N D(arg-list)

6-9

Page 69
Image 69
Intel fortran-80 manual BACKSPACE Statement, REWI N D Statement, File Disposition Specifier, REWI N Darg-list