OPEN, STATUS='NEW' of a symbolic link to a non-existing file.

Steve Kargl sgk@troutmask.apl.washington.edu
Wed Sep 16 17:55:00 GMT 2009


On Wed, Sep 16, 2009 at 10:37:50AM -0700, Steve Kargl wrote:
> On Wed, Sep 16, 2009 at 12:11:43PM +0000, Toon Moene wrote:
> > Toon Moene wrote:
> > 
> > >Most compilers will allow this (the rationale probably being that the 
> > >file doesn't *really* already exists).
> > 
> > >Shall we adapt to the rest of the world ?
> > 
> > On top of this, we are not consistent:
> > 
> >       logical lexist
> >       inquire(file='noot',exist=lexist)
> >       print*,lexist
> >       end
> > 
> > rm aap
> > ln -s aap noot
> > ./a.out
> >  F
> > 
> > So we first tell the user the file doesn't exist, s/he decides to open 
> > it with STATUS='NEW' and then fails.
> > 
> > Bad, bad dog ...
> > 
> 
> Looks like inquire has a bug.
> 
> As you know, the unix philosophy is that everything is a file.
> symlinks (and directories and devices and ...) may by special
> files, but nonetheless they are files.
> 

Having looked at the code for inquire(), the above result is
understandable.

-- 
Steve



More information about the Fortran mailing list