Intel® Fortran Libraries Reference
Intel® Fortran Libraries Reference Intel® Fortran Libraries Reference
2 Intel Fortran Libraries ReferenceSyntaxresult = SYSTEM (string)string(Input) Character*(*). Operating system command.Results:The result type is INTEGER(4). The result is the exit status of the shell command. If –1, use“IERRNO” to retrieve the error. Errors can be one of the following:• E2BIG – The argument list is too long.• ENOENT – The command interpreter cannot be found.• ENOEXEC – The command interpreter file has an invalid format and is not executable.• ENOMEM – Not enough system resources are available to execute the command.On Windows* systems, the calling process waits until the command terminates. To insurecompatibility and consistent behavior, an image can be invoked directly by using the Windows*API CreateProcess( ) in your Fortran code.Commands run with the SYSTEM routine are run in a separate shell. Defaults set with theSYSTEM function, such as current working directory or environment variables, do not affect theenvironment the calling program runs in.The command line character limit for the SYSTEM function is the same limit that your operatingsystem command interpreter accepts.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBSee Also: “SYSTEMQQ”ExampleUSE IFPORTINTEGER(4) I, errnumI = SYSTEM("dir > file.lst")If (I .eq. -1) thenerrnum = ierrno( )print *, 'Error ', errnumend ifEND2-478
Descriptions of the Library Routines 2SYSTEMQQPortability Function: Executes a system command by passing a command string to the operatingsystem’s command interpreter.Module: USE IFPORTSyntaxresult = SYSTEMQQ (commandline)commandline(Input) Character*(*). Command to be passed to the operating system.Results:The result type is LOGICAL(4). The result is .TRUE. if successful; otherwise, .FALSE..The SYSTEMQQ function lets you pass operating-system commands as well as programs.SYSTEMQQ refers to the COMSPEC and PATH environment variables that locate the commandinterpreter file (usually named COMMAND.COM).On Windows* systems, the calling process waits until the command terminates. To insurecompatibility and consistent behavior, an image can be invoked directly by using the Windows*API CreateProcess( ) in your Fortran code.If the function fails, call “GETLASTERRORQQ” to determine the reason. One of the followingerrors can be returned:• ERR$2BIG – The argument list exceeds 128 bytes, or the space required for the environmentformation exceeds 32K.• ERR$NOINT – The command interpreter cannot be found.• ERR$NOEXEC – The command interpreter file has an invalid format and is not executable.• ERR$NOMEM – Not enough memory is available to execute the command; or the availablememory has been corrupted; or an invalid block exists, indicating that the process making thecall was not allocated properly.The command line character limit for the SYSTEMQQ function is the same limit that youroperating system command interpreter accepts.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBSee Also: “SYSTEM”ExampleUSE IFPORTLOGICAL(4) result2-479
- Page 480 and 481: 2 Intel Fortran Libraries Reference
- Page 482 and 483: 2 Intel Fortran Libraries Reference
- Page 484 and 485: 2 Intel Fortran Libraries Reference
- Page 486 and 487: 2 Intel Fortran Libraries Reference
- Page 488 and 489: 2 Intel Fortran Libraries Reference
- Page 490 and 491: 2 Intel Fortran Libraries Reference
- Page 492 and 493: 2 Intel Fortran Libraries Reference
- Page 494 and 495: 2 Intel Fortran Libraries Reference
- Page 496 and 497: 2 Intel Fortran Libraries Reference
- Page 498 and 499: 2 Intel Fortran Libraries Reference
- Page 500 and 501: 2 Intel Fortran Libraries Reference
- Page 502 and 503: 2 Intel Fortran Libraries Reference
- Page 504 and 505: 2 Intel Fortran Libraries Reference
- Page 506 and 507: 2 Intel Fortran Libraries Reference
- Page 508 and 509: 2 Intel Fortran Libraries Reference
- Page 510 and 511: 2 Intel Fortran Libraries Reference
- Page 512 and 513: 2 Intel Fortran Libraries Reference
- Page 514 and 515: 2 Intel Fortran Libraries Reference
- Page 516 and 517: 2 Intel Fortran Libraries Reference
- Page 518 and 519: 2 Intel Fortran Libraries Reference
- Page 520 and 521: 2 Intel Fortran Libraries Reference
- Page 522 and 523: 2 Intel Fortran Libraries Reference
- Page 524 and 525: 2 Intel Fortran Libraries Reference
- Page 526 and 527: 2 Intel Fortran Libraries Reference
- Page 528 and 529: 2 Intel Fortran Libraries Reference
- Page 532 and 533: 2 Intel Fortran Libraries Reference
- Page 534 and 535: 2 Intel Fortran Libraries Reference
- Page 536 and 537: 2 Intel Fortran Libraries Reference
- Page 538 and 539: 2 Intel Fortran Libraries Reference
- Page 540 and 541: 2 Intel Fortran Libraries Reference
- Page 542 and 543: 2 Intel Fortran Libraries Reference
- Page 544 and 545: 2 Intel Fortran Libraries Reference
- Page 546 and 547: Intel Fortran Libraries ReferenceAU
- Page 548 and 549: Intel Fortran Libraries ReferenceCo
- Page 550 and 551: Intel Fortran Libraries ReferenceDD
- Page 552 and 553: Intel Fortran Libraries Referencefu
- Page 554 and 555: Intel Fortran Libraries ReferenceFO
- Page 556 and 557: Intel Fortran Libraries ReferenceGE
- Page 558 and 559: Intel Fortran Libraries Referenceex
- Page 560 and 561: Intel Fortran Libraries ReferenceLT
- Page 562 and 563: Intel Fortran Libraries ReferenceNL
- Page 564 and 565: Intel Fortran Libraries Referencefo
- Page 566 and 567: Intel Fortran Libraries ReferencePX
- Page 568 and 569: Intel Fortran Libraries ReferencePX
- Page 570 and 571: Intel Fortran Libraries ReferencePX
- Page 572 and 573: Intel Fortran Libraries ReferenceRG
- Page 574 and 575: Intel Fortran Libraries ReferenceSE
- Page 576 and 577: Intel Fortran Libraries ReferenceSy
- Page 578 and 579: Intel Fortran Libraries ReferenceWi
2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>Syntaxresult = SYSTEM (string)string(Input) Character*(*). Operating system command.Results:The result type is INTEGER(4). The result is the exit status of the shell command. If –1, use“IERRNO” to retrieve the error. Errors can be one of the following:• E2BIG – The argument list is too long.• ENOENT – The command interpreter cannot be found.• ENOEXEC – The command interpreter file has an invalid format and is not executable.• ENOMEM – Not enough system resources are available to execute the command.On Windows* systems, the calling process waits until the command terminates. To insurecompatibility and consistent behavior, an image can be invoked directly by using the Windows*API CreateProcess( ) in your <strong>Fortran</strong> code.Commands run with the SYSTEM routine are run in a separate shell. Defaults set with theSYSTEM function, such as current working directory or environment variables, do not affect theenvironment the calling program runs in.The command line character limit for the SYSTEM function is the same limit that your operatingsystem command interpreter accepts.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBSee Also: “SYSTEMQQ”ExampleUSE IFPORTINTEGER(4) I, errnumI = SYSTEM("dir > file.lst")If (I .eq. -1) thenerrnum = ierrno( )print *, 'Error ', errnumend ifEND2-478