This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
accessing home directory via ~
- From: "Janus Weil" <jaydub66 at googlemail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 4 Feb 2008 17:02:05 +0100
- Subject: accessing home directory via ~
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=DLNfo1eymhlT5L2Hh0hBHUM6A8ZqRssiQPIE/ztmLrI=; b=W/FmK1x4J0B2Saxh00nPFFHWf1jy2Ca5NsGgyjlimOV+4LHbA/LCN/Q4hfY5aSBF5yv2D/VEqYbskTxI8mqArCax6Tp4UuAJkUWjfCwC1AaMUQohCsCPVwGCW5oAxNyVbtdCPD/Hd8o/BynCiIxMeDWTUgvc4LYJIKsnK0ZGZuY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ORasmrc56i29YnqdIyhMjNijhFlOPDmhCh2UVZLu2pCrJ/dpSFiCoDnNSTkkSplDE35ekjiAqb3v8b7dUwXUjTrw2KUAByNdtVZT2EdM67trI1+6ExzhELOWv9r6y5JY7WhtRr8WknNKZ81KsfO7EoVo2fwT6/8ePIbIxSFkb7E=
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