Allowed return codes from SYSTEM call in ifort/linux.
- From: Keith Refson <kr@xxxxxxxxxxxxxx>
- Date: Wed, 03 Jan 2007 11:13:06 +0000
I am having a problem with the return code from the SYSTEM intrinsic
function in Intel Fortran for linux.
The code is question is simply attempting to rename a file:
status=system("mv -f "//from_file//" "//to_file)
if (status/=0) call io_abort('Error in renaming '//from_file//' to '//to_file)
On most systems this works perfectly well. But on just 3 systems the
status code returned is non-zero, although the rename apparently
succeeded. A slightly deeper investigation reveals a puzzle -
the code returned by "system" is greater than 256. In fact the least
significant byte is zero and the second-least significant byte is nonzero.
According the the "system" entry in the manual this is just the status
code returned by the shell, which according to the bash manpage must
be < 256. It looked as if the rename actually succeeded but that the
system is returning an unexpected status.
In all of the failing cases the file concerned is on a network file
system; one case is AFS, and the other two are panasus filesystems
mounted using NFS. All of the cases were of x86_64 architecture and
the 64-bit compilers were used (9.1.039).
How is it possible for SYSTEM() to return a 16-bit error code? And
if so how should it be interpreted to determine success or failure
of the called command?
Keith Refson
--
Dr Keith Refson,
Building R3
Rutherford Appleton Laboratory
Chilton
Didcot kr AT
Oxfordshire OX11 0QX isise D@T rl D.T ac D?T uk
.
- Follow-Ups:
- Re: Allowed return codes from SYSTEM call in ifort/linux.
- From: Ron Shepard
- Re: Allowed return codes from SYSTEM call in ifort/linux.
- From: Pierre Asselin
- Re: Allowed return codes from SYSTEM call in ifort/linux.
- From: George Trojan
- Re: Allowed return codes from SYSTEM call in ifort/linux.
- Prev by Date: Re: Gfortran 2006 Year End Status Report
- Next by Date: Re: xlf AIX compiler for files with .f and .f90 suffix
- Previous by thread: Distance Transform , Skeletonization , Binary Image
- Next by thread: Re: Allowed return codes from SYSTEM call in ifort/linux.
- Index(es):
Relevant Pages
|