Opened 9 years ago

Closed 9 years ago

Last modified 44 years ago

#389 closed bug (Fixed)

System.Cmd.system fails on Win9x

Reported by: nobody Owned by: nobody
Priority: normal Milestone:
Component: libraries/base Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Vivian McPhail
vivian.mcphail@paradise.net.nz

From a ghci session (6.4):

Prelude> System.Cmd.system "dir"
*** Exception: C:\WINDOWS\SYSTEM\CMD.EXE: runCommand:
does not exist (No such file or directory)

System.Cmd.system tries to run cmd.exe but on Win9x
this is command.com.

These executables are both mentioned in the
documentation so the distinction is not unknown.

I see that the source code for System.Process.Internals
has code for detecting this, but for some reason it
does not appear to be working:

-- Find CMD.EXE (or COMMAND.COM on Win98).  We use the
same algorithm as
-- system() in the VC++ CRT (Vc7/crt/src/system.c in a
VC++ installation).
findCommandInterpreter :: IO FilePath
findCommandInterpreter = do
  -- try COMSPEC first
  catchJust ioErrors (getEnv "COMSPEC") $ \e -> do
    when (not (isDoesNotExistError e)) $ ioError e

    -- try to find CMD.EXE or COMMAND.COM
    osver <- c_get_osver
    let filename | osver .&. 0x8000 /= 0 = "command.com"
		 | otherwise             = "cmd.exe"
    path <- getEnv "PATH"




Change History (2)

comment:1 Changed 9 years ago by nobody

Logged In: NO 

Vivian McPhail
vivian.mcphail@paradise.net.nz

GHC 6.4.1 works, so the bug must have been fixed!

Apologies

comment:2 Changed 9 years ago by simonmar

  • Status changed from assigned to closed
Logged In: YES 
user_id=48280

Yes, already fixed.
Note: See TracTickets for help on using tickets.