Skip to content

Instantly share code, notes, and snippets.

@tmciver
Created August 9, 2020 01:21
Show Gist options
  • Save tmciver/1cefd940707708e728405bf38ef25a41 to your computer and use it in GitHub Desktop.
Save tmciver/1cefd940707708e728405bf38ef25a41 to your computer and use it in GitHub Desktop.
import System.IO
import System.IO.Temp (withSystemTempFile)
f :: FilePath -> Handle -> IO ()
f fp h = do
hSetBuffering h NoBuffering
hPutStr h "Test"
contents <- hGetContents h
putStrLn ("contents is: " ++ contents)
main = withSystemTempFile "test-" f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment