Allowed return codes from SYSTEM call in ifort/linux.



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
.



Relevant Pages

  • Re: Finding installed package files
    ... >>Well I really dislike that the Fedora guys renamed the package. ... the rename is done for a very good reason - changes that make it ... the reason I wanted to replace it was ... the Linux side of my box after using OOo for over a year with XP. ...
    (alt.os.linux.redhat)
  • Re: a long rebuttal to the Linux-is-the-engine fallacy
    ... So it is actually *less* dependent on the BIOS than both Linux and GNU ... Nobody's trying to rename Linux, in spite of Linus' claims that people ... Nobody's trying to rename Fedora. ...
    (Fedora)
  • Using getline in AWK in a Shell function to read from standard input
    ... To rename in a directory lots of files under linux, ... a string common in their names like under DOS as: ... I tried to use it in a function under linux as: ... How can I tell to this function to stop an the getline command to get ...
    (comp.lang.awk)
  • Re: RENDOM or ADMT
    ... OS is W2k3 - But as the file and print server uses samba we are not sure if ... if you only need a new name choose domain rename. ... For both ways install windows DNS instead of linux to make sure you ...
    (microsoft.public.windows.server.active_directory)
  • Re: File renaming
    ... > Will mango contain upto date data? ... Or will the rename cause it to ... but don't have Linux with me.) ...
    (comp.lang.php)