Skip to content

Commit

Permalink
create example of using a handle for the stdout of a process
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-artificial committed Jan 7, 2025
1 parent e13d504 commit d1eb1ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/30-process-handlers.hell
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
main = do
Temp.withSystemTempFile "example" \filePath handle -> do
Text.putStrLn $ Text.concat ["Created temp file ", filePath]
let proc = Process.setStdout (Process.useHandleClose handle) $
Process.proc "ls" ["-al"]
Process.runProcess_ proc
contents <- Text.readFile filePath
Text.putStrLn contents


0 comments on commit d1eb1ae

Please sign in to comment.