module TempDir where

import Foreign.C.String

foreign import ccall "mkdtemp" c_mkdtemp :: CString -> IO CString

mkdtemp :: String -> IO String
mkdtemp template =
    do
      s <- newCString template
      d <- c_mkdtemp s
      peekCString d

