Skip to content

Instantly share code, notes, and snippets.

@exarkun
Last active January 1, 2021 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exarkun/dc0123fb1a099e5a81918d8528a7d13e to your computer and use it in GitHub Desktop.
Save exarkun/dc0123fb1a099e5a81918d8528a7d13e to your computer and use it in GitHub Desktop.
withSystemTempFile "plaintext.txt" $ \path handle -> do
B.hPut handle "Hello, world."
contents <- withBinaryFile path ReadMode B.hGetContents
return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment