This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: OPEN statement in Fortran (g77)
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: "Prof. M.B. Patil" <mbpatil at ee dot iitb dot ac dot in>
- Cc: gcc-bugs at gcc dot gnu dot org, bug-gcc at gnu dot org
- Date: Fri, 12 Sep 2003 20:32:23 +0200
- Subject: Re: OPEN statement in Fortran (g77)
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <Pine.GSO.4.44.0309121921350.28959-100000@bhairav.ee.iitb.ac.in>
Prof. M.B. Patil wrote:
A question about OPEN statement in Fortran:
The following does not seem to work:
open (unit=1,file='~/xyz/try2.in',status='old')
The error message I get is the following:
open: No such file or directory
apparent state: unit 1 named ~xyz/try2.in
lately writing direct unformatted external IO
Aborted
This is unfortunate, but inevitable. The home directory character ~ is
specific to certain shells, i.e., they only work if you type something like:
ls -l ~/xyz/try2.in
in your shell, which interprets it as `ls -l $HOME/xyz/try2.in'.
The above program just opens the file with name '~/xyz/try2.in' - it
doesn't do any such "translation", because the Fortran standard mandates
it to use the name literally.
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)