man tmp_name () - create names for temporary files safely.

NAME

tmp_open, tmp_name, tmp_close - create names for temporary files safely.

LIBRARIES

Abz Library (-labz), Debug Library (-ldebug)

SYNOPSIS

#include <abz/tmp.h>

int tmp_open(const char *tmpdir, const char *progname");
"char*tmp_name();
"voidtmp_close();

DESCRIPTION

The tmp_open() function creates a temporary directory (only accessible by the user of the process in question) for use by the tmp_name() function. You have to specify a temporary directory tmpdir and a program name progname. These strings are used to create a directory of the form <tmpdir>/<progname>hash.

The tmp_name() function creates a name for a temporary file which is safe to use.

The tmp_close() function removes the directory created by tmp_open(). It is the responsibility of the programmer to ensure that the directory is empty (i.e. all the files/directories created with names generated by tmp_name() were removed) by the time this function is called.

RETURN VALUES

The tmp_open() function returns 0 if successful, -1 if not.

The tmp_name() function returns a name if successful, NULL if not.

Check errno to see what error occurred.

NOTES

None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/

AUTHOR

Written by Abraham vd Merwe <abz@blio.com>

CETTE PAGE DOCUMENTE AUSSI :