MH-MKSTEMP(1mh)

πŸ“¦
version 1.8 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– MH-MKSTEMP β€” bestie edition πŸ’–

okay so you know the mkstemp command from the nmh manual, section 1mh? yeah. we're doing this. sit down, grab a strawberry πŸ“, and let's make a temporary file together, it's literally so easy.


✨ NAME ✨

mkstemp β€” create a temporary file πŸŽ€


✨ SYNOPSIS ✨

/usr/lib/mh/mkstemp [-help] [-version] [-directory directory] [-prefix
     prefix] [-suffix suffix]

that's it. that's the whole vibe. she's simple, she's iconic πŸ‘‘


✨ DESCRIPTION ✨

so mkstemp makes you a temporary file β€” it's using mkstemp(3) under the hood, or mkstemps(3) if the -suffix switch is available and you actually use it. the file name it gives you identifies a unique, newly created file, and no cap it always contains 6 characters that appear to be random. six. every time. πŸ’…

the -directory switch tells it which directory to create the file in. like, where do you want this lil guy to live bestie 🏠

the -prefix switch sets an initial part of the file name β€” it goes before those 6 characters. so you can name your temp file something cute instead of it being anonymous.

the -suffix switch, okay listen, this one's conditional β€” it's only supported on platforms that provide the mkstemps(3) library function. it specifies a suffix to appear after the 6 characters. and heads up: if you want that suffix to begin with a special character like a period, that has to be explicit in suffix β€” it will not do it for you, it does not read your mind πŸ™ˆ

and here's the lowkey weird part that's actually so slay: unlike arguments to most switches of other nmh commands, the arguments to mkstemp switches can begin with a dash. fr fr. dashes allowed. wild, I know πŸ’€

✨ 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. not slay. 😭

✨ PROFILE COMPONENTS ✨

None

nothing. empty. zero. it's giving minimalism πŸ¦‹


✨ SEE ALSO ✨

mkstemp(3), mkstemps(3)

go read those too, they're the main characters of this whole thing iykyk πŸ“š


✨ DEFAULTS ✨

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

reminder bestie: this page is from nmh-1.8, dated 2014-03-16. go make your temp files, you're doing amazing, mwah πŸ’–πŸ«ΆπŸŒΈ
πŸ“¦ where this page comes from