Flashnux

GNU/Linux man pages

Livre :
Expressions régulières,
Syntaxe et mise en oeuvre :

ISBN : 978-2-7460-9712-4
EAN : 9782746097124
(Editions ENI)

GNU/Linux

RedHat 5.2

(Apollo)

tempnam(3)


TEMPNAM

TEMPNAM

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
CONFORMING TO
SEE ALSO

NAME

tempnam − create a name for a temporary file

SYNOPSIS

#include <stdio.h>

char *tempnam(const char *dir, const char *pfx);

DESCRIPTION

The tempnam() function generates a unique temporary filename using up to five characters of pfx, if it is not NULL. The directory to place the file is searched for in the following order:-

a)

The directory specified by the environment variable TMPDIR, if it is writable.

b)

The directory specified by the argument dir, if it is not NULL.

c)

The directory specified by P_tmpdir.

d)

The directory /tmp.

The storage for the filename is allocated by malloc(), and so can be free’d by the function free().

RETURN VALUE

The tempnam() function returns a pointer to the unique temporary filename, or NULL if a unique filename cannot be generated.

ERRORS

EEXIST

Unable to generate a unique filename.

CONFORMING TO

SVID 3, BSD 4.3

SEE ALSO

mktemp(3), mkstemp(3), tmpnam(3), tmpfile(3)



tempnam(3)