OPEN statement in Fortran (g77)

Prof. M.B. Patil mbpatil@ee.iitb.ac.in
Fri Sep 12 14:11:00 GMT 2003


Dear Sir/Madam,

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

      open (unit=1,file='/home/username/xyz/try2.in',status='old')
does work.

Also,
      open (unit=1,file='/home/username/xyz/try2.in',status='old')

In other words, a reference to the home directory with tilde (~)
is not liked by the compiler. (I checked that '../xyz/abc' works
fine with the OPEN statement.)

Please let me know if there is a way out.

Thanks.
Mahesh Patil




More information about the Gcc-bugs mailing list