#6094: runInteractiveProcess not using new PATH
------------------------------+---------------------------------------------
 Reporter:  GregWeber         |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.4.1             |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 run the below program with something like: rm -r foo; ghc env.hs && ./env

 {{{
 import System.Process( runInteractiveProcess, waitForProcess,
 ProcessHandle )
 import System.Directory

 main = do
   createDirectory "foo"
   writeFile "foo/bar" "#!/bin/sh\necho baz"
   (inH,outH,errH,procH) <- runInteractiveProcess "chmod" ["+x",
 "./foo/bar"] Nothing $ Just [("PATH","./foo")]
   ex <- waitForProcess procH
   print ex -- ExitSuccess
   (inH,outH,errH,procH) <- runInteractiveProcess "env" ["PATH=./foo",
 "bar"] Nothing $ Just [("PATH","./foo")]
   ex <- waitForProcess procH
   print ex -- ExitSuccess
   (inH,outH,errH,procH) <- runInteractiveProcess "bar" [] Nothing $ Just
 [("PATH","./foo")]
   ex <- waitForProcess procH
   print ex -- ExitFailure 127 (indicates command not found)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6094>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to