HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleunix-compat-0.7.4.1Haskell2010

System.PosixCompat.Temp

This module makes the operations exported by System.Posix.Temp available on all platforms. On POSIX systems it re-exports operations from System.Posix.Temp, on other platforms it emulates the operations as far as possible.

  • 1 value
valuemkstemp :: String -> IO (FilePath, Handle)
#

Make a unique filename and open it for reading/writing. The returned FilePath is the (possibly relative) path of the created file, which is padded with 6 random characters. The argument is the desired prefix of the filepath of the temporary file to be created.

If you aren't using GHC or Hugs then this function simply wraps mktemp and so shouldn't be considered safe.