RE: Problem with ghc on Windows ME

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 command: \" 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 least. 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. Cheers, Simon

"Simon Marlow"
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.
This is probably a silly naming question, but aren't the names of 'System.system' and 'rawSystem' the wrong way round? On the face of things, it would seem sensible for System.system to have the more portable behaviour, and rawSystem to be dependent on local conventions. After all, System.system is defined in the official Libraries Report making no mention of any portability problems, whereas the name 'raw' suggests that no interpretation/quoting is going on, and hence it may be highly dependent on the underlying system. Regards, Malcolm

On Thu, 2004-01-29 at 03:31, Simon Marlow wrote:
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 command:
\"
I got the idea from the original description that it was also impossible to send an argument which ended with a backslash. Is this true? Has anybody found a workaround for this? Carl Witty
participants (3)
-
Carl Witty
-
Malcolm Wallace
-
Simon Marlow