Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Calling system commands

Intel_C_Intel
Employee
718 Views
Sorry if this is rather elementary...

Could someone tell me which Fortran command I need to call a system command (i.e. to run a command as if it was entered on the linux command line)? In other versions of Fortran compiler, I have seen the "system" function but I can't see anything similar in the Intel Fortran language description manual.

Thanks very much.

Tim Camp
0 Kudos
4 Replies
TimP
Honored Contributor III
718 Views
Both the system() and systemqq() functions are written up in lib_for.pdf, and have interface blocks provided by USE IFPORT. They differ only in that system() returns integer status codes, while systemqq() returns logical.

Message Edited by tim18 on 09-07-2005 06:57 AM

0 Kudos
Intel_C_Intel
Employee
718 Views
Many thanks Tim.
For your info, I checked in the latest version of for_lang.pdf (the ver 9.x copy from http://www.intel.com/support/performancetools/fortran/linux/sb/cs-007823.htm) but couldn't find these two functions described(?).
I guess the argument is simply a string giving the operating system command.
Tim Camp
0 Kudos
Steven_L_Intel1
Employee
718 Views
Because these are not intrinsic functions, implemented by the compiler, they are not in the Language Reference. Look instead in the Libraries manual.

Yes, the argument is the command string you want executed. They are functions returning an integer status. You should add a:

use ifport

in the program unit that uses them.
0 Kudos
Intel_C_Intel
Employee
718 Views
Thanks very much.
Tim
0 Kudos
Reply