mktemp

QNX SDP8.0Utilities ReferenceUtilities

Create a unique temporary file or directory (POSIX, toybox)

Syntax:

mktemp [-dqu] [-p dir] [template]

Runs on:

QNX OS

Options:

-d --directory
Create directory instead of a file.
-p dir --tmpdir
Put a new file in the specified dir.
-q
Be quiet, no error messages.
-t
Create the temporary file in a temporary directory. The process for selecting a temporary directory is as follows:
  1. the TMPDIR environment variable, if set add comma
  2. the directory specified with the -p option
  3. /tmp
If you don't set -t, then mktemp chooses the directory specified with -p over the TMPDIR environment variable (default).
-u
Don't create anything, just print what would be created.
template
A filename with a specified number of Xs appended to it.

Description:

The mktemp utility creates a unique temporary file or directory and prints its name. The template can be any filename with at least six X characters appended to it. The Xs are replaced with a unique combination of alphanumeric characters. If you don't specify a template, then mktemp uses tmp.XXXXXXXXXX, and the -t option is implied.

This utility is provided as part of the toybox package. For information on how to enable it, see toybox.

Contributing author:

Rob Landley and the toybox project (see https://landley.net/toybox/).

Page updated: