On 23 March 2005 15:34, Sigbjorn Finne wrote:
> "Simon Marlow" <[EMAIL PROTECTED]> writes:
>>
> ...
>>> Prelude> System.system "ls" >>= print
>>> *** Exception: C:\WINDOWS\SYSTEM\CMD.EXE: runCommand: does not
>>> exist (No such fi le or directory) Prelude> System.Cmd.rawSystem
>>> "ls" [] >>= print _viminfo getname.pl index.html
>>> ExitSuccess
>>> Prelude> System.system "false" >>= print
>>> *** Exception: C:\WINDOWS\SYSTEM\CMD.EXE: runCommand: does not
>>> exist (No such fi le or directory) Prelude> System.Cmd.rawSystem
>>> "false" [] >>= print
>>> ExitFailure 1
>>
>> Works for me! Remember that System.system is executing CMD.EXE, not
>> Cygwin bash, so it'll probably have a different PATH and might not be
>> able to find your Cygwin binaries. Both System.system "dir", and
>> System.system "c:/cygwin/bin/ls" work for me.
>>
>
> There's no such thing as cmd.exe on Win9x, it's COMMAND.EXE/COM.
> Some System.Process.* code ought to be looking at the COMSPEC env
> variable and not hard-code the name of the command processor. However,
> I don't think COMMAND.EXE supports the /c switch...why the switch away
> from just using libc/msvcrt's system() for System.system?
Because we want to get a ProcessHandle that we can wait on, and system()
doesn't give us that.
What's the right way to do this on Win98? If COMMAND.EXE doesn't
support /c, there must be an alternative... perhaps I should just look
up the implementation of system() in msvcrt?
Cheers,
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs