Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Physical Devices on Windows

Input/Output (I/O) statements that do not refer to a specific file or I/O device read from standard input and write to standard output. Standard input is the keyboard, and standard output is the screen (console). To perform input and output on a physical device other than the keyboard or screen, specify the device name as the file name to be read from or written to.

Some physical device names are determined by the host operating system; others are recognized by Intel® Fortran. Extensions on most device names are ignored.

The following table shows file names for device I/O:

Device

Description

CON

Console (standard output)

PRN

Printer

COM1

Serial port #1

COM2

Serial port #2

COM3

Serial port #3

COM4

Serial port #4

LPT1

Parallel Port #1

LPT2

Parallel Port #2

LPT3

Parallel Port #3

LPT4

Parallel Port #4

NUL

NULL device. Discards all output; contains no input.

AUX

Serial port #1

LINE

Serial port #1

USER

Standard output

ERR

Standard error

CONOUT$

Standard output

CONIN$

Standard input

NOTE:

If you use the LINE, USER, or ERR name with an extension, for example, LINE.TXT, Fortran will write to a file rather than to the device.

Examples of opening physical devices as units are:

  OPEN (UNIT = 4, FILE = 'PRN')
  OPEN (UNIT = 7, FILE = 'LPT2', ERR = 100)