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-2.8.7.0Haskell2010

System.Posix.Temp.PosixString

POSIX temporary file and directory creation functions.

  • 3 values
  • Packageunix-2.8.7.0
  • Exports3
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePosixString.hsc

Make a unique filename and open it for reading/writing. The returned PosixPath 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.

mkstemps - make a unique filename with a given prefix and suffix and open it for reading/writing (only safe on GHC & Hugs). The returned PosixPath is the (possibly relative) path of the created file, which contains 6 random characters in between the prefix and suffix.

Make a unique directory. The returned PosixPath is the path of the created directory, which is padded with 6 random characters. The argument is the desired prefix of the filepath of the temporary directory to be created.

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