This commit is contained in:
Joey Hess 2012-01-21 02:24:12 -04:00
parent eb9001044f
commit 183bdacca2
4 changed files with 12 additions and 8 deletions

View file

@ -26,8 +26,10 @@ viaTmp a file content = do
a tmpfile content
renameFile tmpfile file
type Template = String
{- Runs an action with a temp file, then removes the file. -}
withTempFile :: String -> (FilePath -> Handle -> IO a) -> IO a
withTempFile :: Template -> (FilePath -> Handle -> IO a) -> IO a
withTempFile template a = bracket create remove use
where
create = do