Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending input to spawned process hangs #62

Open
rahulmutt opened this issue Nov 30, 2017 · 0 comments
Open

Sending input to spawned process hangs #62

rahulmutt opened this issue Nov 30, 2017 · 0 comments
Labels

Comments

@rahulmutt
Copy link
Member

rahulmutt commented Nov 30, 2017

From: https://lotz84.github.io/haskellbyexample/ex/spawning-processes

import System.Process
import System.IO

main :: IO ()
main = do
    (Just hin, Just hout, _, _) <- createProcess (proc "grep" ["hello"]){ std_in = CreatePipe, std_out = CreatePipe }
    hPutStr hin "hello grep\ngoodbye grep"
    grepBytes <- hGetContents hout
    putStrLn "> grep hello"
    putStrLn grepBytes

should give

> grep hello
hello grep

but gives

> grep hello
[hangs]
@rahulmutt rahulmutt added the bug label Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant