Problem with ghc on Windows ME

Simon Marlow simonmar at
Thu Jan 29 11:31:03 EST 2004

> So does that mean functionality has been lost in the move from
> ghc-6.0.1?

No, the behaviour is improved in 6.2 because we're now careful to escape
quotes before passing the command-line to the operating system.

I think confusion has arisen because Simon pointed out that there's no
way, on Windows, to pass this sequence of characters as an argument to a

This is not entirely true, I just discovered that the sequence \\\" will
turn into \".  But in general, the sequence \\ does not turn into \.
Windows' command-line quoting rules are highly mysterious, to say the

So the patch I posted is not complete.  It looks like rawSystem should
additionally translate \" as \\\".

> Because that (on win98) happily accepts such useful
> contraptions as
>     System.Cmd.rawSystem "\"c:\\silly 
> space\\Vim\\vim62\\gvim.exe\" --servername GVIM --remote-send
> \":echo \\\"hi \\\\\\\" there\\\"<cr>\"" >>= print

The idea is that you should pass to rawSystem *exactly* the command and
arguments you want to run, with no quoting except that required by the
Haskell lexical syntax.  You'll notice that rawSystem now takes the
command and list of arguments separately in 6.2.  The implementation of
rawSystem will attempt to compensate for the internal translation that
Windows does on the command-line; on Unix no translation is necessary.
So clients of rawSystem should be more portable, because they don't have
to know about quoting that happens under the hood.

Your example will probably work once it's reformulated for 6.2's version
of rawSystem, and once we fix rawSystem in light of the \\\" hack I
discovered above.


More information about the Glasgow-haskell-users mailing list