ns_mktemp(3aolserver)

ns_mktemp3aolserver

Commands

Usage

ns_mktemp template ns_tmpnam

Overview

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

Keywords

Releases

Unchanged in 5 releases since Debian 5.0 (Lenny).

  1. 5.0–9

From aolserver4-dev 4.5.1-18.1 in Debian 9 (Stretch). Parsed by carta from the page's man source.