SYSTEM Subroutine
Lahey/Fujitsu Fortran

SYSTEM Subroutine

Description

The SYSTEM subroutine executes a system command as if from the command line.


Syntax

SYSTEM (cmd [, dosbox] [, spawn] )

Required Arguments

cmd is an INTENT(IN) scalar of type CHARACTER. It is the system command to be executed as if it were typed on the command line.

Optional Arguments

dosbox is an INTENT(IN) scalar of type LOGICAL. It has the value true if a new DOS box is to be opened (required for internal commands like DIR) and false otherwise. By default, dosbox has the value true.

spawn is an INTENT(IN) scalar of type LOGICAL. It has the value true if the command or program to be executed is to be spawned as a separate process and false otherwise. By default, spawn has the value false.

Example

call system("dir > current.dir") ! puts a listing of the current directory into ! the file 'current.dir'