---
name: "ns_tmp"
section: "3"
platform: "linux"
package: "aolserver4"
version: "4.0.10-7"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/ns_tmp"
---

# ns\_tmp(3)

commands

## NAME

ns\_mktemp, ns\_tmpnam - commands

## SYNOPSIS

**ns\_mktemp** *template* **ns\_tmpnam**

## DESCRIPTION

**ns\_mktemp** returns a unique filename based on the *template* you specify.  **ns\_tmpnam** returns a filename that can safely be used  for a temporary file.

The *template* for **ns\_mktemp** should contain a string with six trailing Xs, which will be replaced with an alpha-numeric string of six characters chosen to make the filename unique.  If *template* does not end with six trailing Xs the empty string will be returned.

**ns\_tmpnam** calls the tmpnam() C library function, and the results will depend on your operating system.  On Irix, for example, tmpnam() always generate a file name using the path-prefix defined as P\_tmpdir in the header file which is "/var/tmp/".

## EXAMPLES

 nscp\> ns\_tmpnam ;# On Linux\
  /tmp/filevuLwaE

 nscp\> ns\_mktemp /tmp/foobar.XXXXXX\
  /tmp/foobar.p6SlaC

## SEE ALSO

nsd(1), [mktemp(3)](/mktemp/3.md), [tmpnam(3)](/tmpnam/3.md)

## KEYWORDS
