|
RE: bug in System.system on ghc-6.2.1: msg#00023lang.haskell.glasgow.bugs
On 20 July 2004 13:39, Malcolm Wallace wrote: > Using the glibc-2.2 (RedHat 7) Linux binary package of ghc-6.2.1, > the following program: > > import System.Cmd > main = do v <- system("ghc --version 2>&1") > print v > > incorrectly gives > > ExitFailure 127 Are you sure your shell understands the '>&' syntax? Not all do. > whereas with the glibc-2.3 Linux binary package of ghc-6.2.1, the > same program correctly gives > > The Glorious Glasgow Haskell Compilation System, version 6.2.1 > ExitSuccess Assuming you're using the same shell in both cases, this could indicate a problem somewhere. Could you try strace on the binary? > If we change the use of "system" to "rawSystem", both versions work > fine. > > import System.Cmd > main = do v <- rawSystem "ghc" ["--version","2>&1"] > print v > > However, rawSystem is not portable across compiler implementations, > whereas System.system is supposed to be. The '2>&1' will be passed as a raw argument to GHC in this case. Fortunately GHC is ignoring it. Cheers, Simon
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | bug in System.system on ghc-6.2.1, Malcolm Wallace |
|---|---|
| Next by Date: | Re: bug in System.system on ghc-6.2.1, Malcolm Wallace |
| Previous by Thread: | bug in System.system on ghc-6.2.1, Malcolm Wallace |
| Next by Thread: | Re: bug in System.system on ghc-6.2.1, Malcolm Wallace |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |