Hugs, Mac OS X 10.1.5, and pathnames

Sigbjorn Finne sof@galois.com
Mon, 7 Oct 2002 16:47:44 -0700


Hi,

thanks for the report. The upcoming release fixes this
usability issue, treating "\ " as " " in filenames (only.)

--sigbjorn

----- Original Message -----
From: "Hamilton Richards" <hrichrds@swbell.net>
To: <hugs-bugs@haskell.org>; <hugs-users@haskell.org>
Sent: Saturday, August 31, 2002 14:20
Subject: Hugs, Mac OS X 10.1.5, and pathnames


> In OS X, pathnames have two distinct syntaxes. The GUI uses the pre-X
> syntax, in which a pathname begins with a volume name and the
> separator is `:', as in
>
> Macintosh HD:Users:ham:Documents:whatever.hs
>
> In the Darwin (i.e., unix) command-line "underworld", a pathname
> begins with /Volumes, spaces are escaped with `\', and the separator
> is `/', as in
>
> /Volumes/Macintosh\ HD/Users/ham/Documents/whatever.hs
>
> When you drag a file icon onto the command line, Terminal does the
> right thing-- it converts the pathname from the GUI syntax to the
> Darwin syntax, and utilities such as more work just as they should.
>
> Hugs, however, doesn't do so well. For example,
>
>     Prelude> :l /Volumes/Macintosh\ HD/Users/ham/Documents/whatever.hs
>     Reading file "/Volumes/Macintosh\":
>     ERROR "/Volumes/Macintosh\" - Unable to open file
"/Volumes/Macintosh\"
>
> Quoting the pathname changes the problem, but doesn't cure it:
>
>     Prelude> :l "/Volumes/Macintosh\ HD/Users/ham/Documents/whatever.hs"
>     ERROR - Missing `\' terminating string literal gap
>
> Apparently what's confusing Hugs is the `\', because removing it
> cures the problem:
>
>     Prelude> :l "/Volumes/Macintosh HD/Users/ham/Documents/whatever.hs"
>     Reading file "/Volumes/Macintosh HD/Users/ham/Documents/whatever.hs":
>
> Is this problem unavoidable, or is it just an oversight?
>
> Thanks,
>
> --Ham