
rawSystem :: FilePath -> [String] -> IO ExitCode
Question: how do you get the string \" into an argument? Turns out that the argument "\\"" does not do the job. (This turns into a single \.) Puzzling but probably not important in practice.
This comment is puzzling me: I tend to use System.system a lot - this is probably not implemented in terms of rawSystem, with a shell as FilePath, but via a separate system-call? For system, I do need doublequotes in arguments (e.g., when passing complex option flags to the programs invoked, or when the arguments contain strings). Can that really always be avoided for rawSystem? Btw, I do have a win98 box, but it is in no state to compile big programs, let alone ghc (apart from speed, or the lack of it, I have to delete stuff whenever I want to recompile my own projects..). So if you could post a small test case (a Haskell file defining rawSystem and its ffi call/translation, and the kind of call you need to execute through it) that could be run through ghc-6.0.1 (binary release), it would be a lot easier to help with initial testing, even though that wouldn't guarantee successful bootstraps. Claus PS quoting issues are notoriously tricky, especially in programs that are meant to run on multiple platforms. I'm still hunting a case of quoting that works under win98, but not under winXP, where apart from Haskell code, several other progs and shells are involved, and even ridiculously small changes can break things there (e.g., because the example suddenly no longer fits a special case and is treated completely differently). I can't see a problem with removing double escapes for backslashes, but would recommend testing in all cases.