Directory.doesDirectoryExist inconsistency
Mike Thomas
miketh at brisbane.paradigmgeo.com
Tue Oct 22 21:45:44 EDT 2002
Hi there.
> That would take care of the incompatibility here, but
> it's a slippery slope.
Just how slippery the filename slope can get is shown by Common Lisp
filename/logical pathnames:
http://www.cs.queensu.ca/software_docs/gnudev/gcl-ansi/gcl_1063.html#SEC1063
> Should Haskell provide you with
> a platform-independent view of filenames and file
> systems?
I think that if a language implementation takes the trouble to provide a
cross-platform library function then that function should be consistent
across those platforms up to the limits of available programmer time and
common sense.
For example, I think that Haskell 98 library functions should have
particular care applied to them and I think that the trailing "/" problem
should be eliminated. Allowable cross platform variations should be
documented in the standard.
By the same logic, I don't believe that much effort at all should be applied
to reproducing cross-platform behaviour in the GHC Posix library on systems
which do not support Posix.
Generally I think that compilers striving to support production programming
should, where possible, provide at least basic coverage of low level system
specific libraries and low level programming. Such coverage in tandem with
efficient higher level abstracted libraries such as ObjectIO, gives
programmers lots of useful options and is a great strength of GHC.
Cheers
Mike Thomas.
>
> --sigbjorn
>
> ----- Original Message -----
> From: "Simon Peyton-Jones" <simonpj at microsoft.com>
> To: "Sigbjorn Finne" <sof at galois.com>; "Claus Reinke"
> <claus.reinke at talk21.com>
> Cc: <glasgow-haskell-bugs at haskell.org>
> Sent: Tuesday, October 22, 2002 08:50
> Subject: RE: Directory.doesDirectoryExist inconsistency
>
>
> > Sigbjorn (and others interested in Win32 I/O behaviour)
> >
> > The fact that MS CRT differs from Unix doesn't mean that the Haskell
> > interface should necessarily differ. The Haskell impl of
> > doesDirectoryExist could, on Win32, trim off trailing '/' or '\', in
> > order to make the behaviour consistent. Where it's possible to get
> > consistent behaviour, we should strive for that. Do you agree?
> >
> > Simon
> >
> > | -----Original Message-----
> > | From: Sigbjorn Finne [mailto:sof at galois.com]
> > | Sent: 16 October 2002 15:54
> > | To: Claus Reinke
> > | Cc: glasgow-haskell-bugs at haskell.org
> > | Subject: Re: Directory.doesDirectoryExist inconsistency
> > |
> > | This is known behaviour of the MS CRT implementation
> > | of stat() on directories -- trailing slashes will cause it to
> > | report ENOENT.
> > |
> > | Undesirable behaviour, you might (reasonably) say, but
> > | the format of FilePaths is left system-specific by Haskell98.
> > |
> > | --sigbjorn
> > |
> > | ----- Original Message -----
> > | From: "Claus Reinke" <claus.reinke at talk21.com>
> > | To: <glasgow-haskell-bugs at haskell.org>
> > | Sent: Wednesday, October 16, 2002 07:21
> > | Subject: Directory.doesDirectoryExist inconsistency
> > |
> > |
> > | > I've just been chasing a portability problem, where a largish
> > third-party
> > | > program works fine on our suns (ghc-5.02.3), but chokes under
> > | > cygwin/windows (ghc-5.04). Comes down to an inconsistency in the
> > | > handling of (trailing?) slashes in Directory.doesDirectoryExist (see
> > | > a and b below).
> > | >
> > | ...
> > |
> > | _______________________________________________
> > | Glasgow-haskell-bugs mailing list
> > | Glasgow-haskell-bugs at haskell.org
> > | http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
> > _______________________________________________
> > Glasgow-haskell-bugs mailing list
> > Glasgow-haskell-bugs at haskell.org
> > http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
>
> _______________________________________________
> Glasgow-haskell-bugs mailing list
> Glasgow-haskell-bugs at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
>
More information about the Glasgow-haskell-bugs
mailing list