The FILE specifier indicates the name of the file to be connected to the unit. It takes the following form:
FILE = name
name
Is a character or numeric expression.
The name can be any pathname allowed by the operating system.
Any trailing blanks in the name are ignored.
If the following conditions occur:
then Intel® Fortran generates a file name in the form fort.n, where n is the logical unit number. On Windows systems, if compiler option fpscomp general is specified, omitting FILE implies STATUS='SCRATCH'.
If the file name is stored in a numeric scalar or array, the name must consist of ASCII characters terminated by an ASCII null character (zero byte). However, if it is stored in a character scalar or array, it must not contain a zero byte.
If the filename is 'USER' or 'CON', input and output are directed to the console. For a complete list of device names, see Physical Devices in Building Applications.
In a Windows* QuickWin application, you can specify FILE='USER' to open a child window. All subsequent I/O statements directed to that unit appear in the child window.
The name can be blank (FILE=' ') if the compatibility compiler option fpscomp filesfromcmd is specified. If the name is blank, the following occurs:
Assume the following command line started the program MYPROG (note that quotation marks (") are used):
myprog first.fil " " third.txt
MYPROG contains four OPEN statements with blank filenames, in the following order:
OPEN (2, FILE = ' ')
OPEN (4, FILE = ' ')
OPEN (5, FILE = ' ')
OPEN (10, FILE = ' ')
Unit 2 is associated with the file FIRST.FIL. Because a blank argument was specified on the command line for the second filename, the OPEN statement for unit 4 produces the following prompt:
Filename missing or blank -
Please enter name UNIT 4?
Unit 5 is associated with the file THIRD.TXT. Because no fourth file was specified on the command line, the OPEN statement for unit 10 produces the following prompt:
Filename missing or blank -
Please enter name UNIT 10?
See Also