Skip to content
Prev 14152 / 398503 Next

.Fortran()

On Wed, 10 Oct 2001, Jari Oksanen wrote:

            
Not really.  Both `may' and `can' signify possibility, not certainty.
There is at least one R implementation in which it works, so either would be
appropriate.  `may not' would mean that there was one where it did not,
and although that is currently known, it may become unknown at some later
date.

I'll expand the statement.
In general, no.  Indeed, in general Fortran formatted files are a
completely separate type of file (although I doubt R runs on any such
platform).  The problems are

(a) R is a C program linking in Fortran compiled code and libraries, and
the Fortran I/O may not be initialized, and

(b) C and Fortran I/O may be trying to use the same underlying mechanism
and assuming they have exclusive access to it, thereby corrupting the
other attempt.

These are much less likely with C/Fortran compiler pairs like gcc/g77,
but on some platforms we advocate using higher-performance native Fortran
compilers (e.g. on Solaris where f95 optimizes much better than g77, and
has high-performance libraries).
I would do it that way, even invoke the external program via system.
It's tempting to use pipe/fifo connections, but they are not very portable.