Simplify mktemp
. Fixes #98
This commit is contained in:
parent
681f5d3da9
commit
c833de0b45
2 changed files with 4 additions and 4 deletions
|
@ -887,14 +887,14 @@ mktemp
|
|||
-- ^ Parent directory
|
||||
-> Text
|
||||
-- ^ File name template
|
||||
-> Managed (FilePath, Handle)
|
||||
-> Managed FilePath
|
||||
mktemp parent prefix = do
|
||||
let parent' = Filesystem.encodeString parent
|
||||
let prefix' = unpack prefix
|
||||
(file', handle) <- managed (\k ->
|
||||
withTempFile parent' prefix' (\file' handle -> k (file', handle)) )
|
||||
let file = Filesystem.decodeString file'
|
||||
return (file, handle)
|
||||
liftIO (hClose handle)
|
||||
return (Filesystem.decodeString file')
|
||||
|
||||
-- | Fork a thread, acquiring an `Async` value
|
||||
fork :: IO a -> Managed (Async a)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Name: turtle
|
||||
Version: 1.2.1
|
||||
Version: 1.3.0
|
||||
Cabal-Version: >=1.10
|
||||
Build-Type: Simple
|
||||
License: BSD3
|
||||
|
|
Loading…
Reference in a new issue