HomeFreeBSD

mktemp: add -p/--tmpdir argument

Description

mktemp: add -p/--tmpdir argument

This matches other mktemp implementations, including OpenBSD and GNU.
The -p option can be used to provide a tmpdir prefix for specified
templates. Precedence works out like so:

-t flag:

  • $TMPDIR
  • -p directory
  • /tmp

Implied -t flag (no arguments or only -d flag):

  • -p directory
  • $TMPDIR
  • /tmp

Some tests have been added for mktemp(1) in the process.

Reviewed by: imp (earlier version), wosch
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37121

Details

Provenance
kevansAuthored on Oct 31 2022, 3:55 AM
Reviewer
imp
Differential Revision
D37121: mktemp: add -p/--tmpdir argument
Parents
rGcfc57d7dbe5b: mktemp: add some GNU-compatible long options
Branches
Unknown
Tags
Unknown