msgpack-idl-0.2.0: Language/MessagePack/IDL/Internal.hs
module Language.MessagePack.IDL.Internal (
withDirectory
) where
import Control.Exception
import System.Directory
withDirectory :: FilePath -> IO a -> IO a
withDirectory dir m = do
createDirectoryIfMissing True dir
bracket
getCurrentDirectory
setCurrentDirectory
(\_ -> setCurrentDirectory dir >> m)