This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

accessing home directory via ~


Dear gfortraners,
I just noticed that it is not possible with gfortran to access the
user's home directory via the '~' character, as done in the following
short program:

program home

implicit none

open(99,file='~/test.dat')

write(99,*) 'hello world!'

close(99)

end program

When I compile this program with a recent 4.3 trunk build, I get the
following error at runtime:

At line 5 of file home.f90 (unit = 99, file = '')
Fortran runtime error: File '~/test.dat' does not exist

I have no idea if the Fortran standard says anything about this, and I
guess it's not really platform independent, but at least under
unix/linux using the '~' for the home directory is a common
convention. And when compiled with ifort this program works as
expected.

So, should I consider this behaviour a bug or a feature of gfortran?
Cheers,
Janus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]