MH-MKSTEMP(1)

πŸ“¦
version 1.8 Β· 3 versions
, in alpine 3.24, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0

✨ MKSTEMP β€” create a temporary file ✨

okay bestie, welcome to the MH-MKSTEMP(1) page, part of the General Commands Manual family πŸ’– this one is short and sweet and lowkey iconic, so let's go πŸ¦‹


🌸 SYNOPSIS 🌸

/usr/libexec/nmh/mkstemp [-help] [-version] [-directory directory]
     [-prefix prefix] [-suffix suffix]

that's the whole vibe. five-ish switches, zero drama πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so mkstemp creates a temporary file using mkstemp(3), or β€” if the -suffix switch is available and you actually use it β€” mkstemps(3). no cap.

the file name identifies a unique, newly created file, and it always contains 6 characters that appear to be random. six. every time. periodt ✨

here's the switch-by-switch breakdown:

  • -directory β€” specifies a directory in which to create the file πŸ“
  • -prefix β€” specifies an initial part, before the 6 characters, of the file name 🌸
  • -suffix β€” only supported on platforms that provide the mkstemps(3) library function. it specifies a suffix to appear after the 6 characters; if it should begin with a special character such as a period, that must be explicit in suffix πŸ’€ (yes, you have to type the dot yourself, the code is not gonna read your mind bestie)
🫢 important lore: unlike arguments to most switches of other nmh commands, the arguments to mkstemp switches can begin with a dash. so don't panic when you see one, it's fine, it's giving chaotic but valid.

πŸ‘‘ EXIT STATUS πŸ‘‘

if mkstemp successfully creates the temporary file, it prints the file name on standard output and exits with status 0. slay βœ…

on failure, it prints a diagnostic message on standard error and exits with status 1 😭


🧚 PROFILE COMPONENTS 🧚

None

literally none. nothing. empty. the void. and honestly? iconic πŸ•³οΈβœ¨


🌈 SEE ALSO 🌈


⭐ DEFAULTS ⭐

  • -directory β€” current directory
  • -prefix β€” none
  • -suffix β€” none

πŸ’œ and that's the whole page, bestie. go forth and make temp files responsibly.

this was nmh-1.8, dated 2014-03-16 β€” yes she's vintage, yes she still ate πŸ’…πŸ‘‘

πŸ“¦ where this page comes from