SDDS ToolKit Programs and Libraries for C and Python
|
Provides functions to generate unique temporary filenames.
Definition in file tmpname.c.
#include "mdb.h"
#include <time.h>
#include <unistd.h>
#include <errno.h>
Go to the source code of this file.
Functions | |
char * | tmpname (char *s) |
Supplies a unique temporary filename. | |
char * | mktempOAG (char *template) |
Generates a unique temporary filename based on a template. | |
char * mktempOAG | ( | char * | template | ) |
Generates a unique temporary filename based on a template.
Replaces the last six characters ('XXXXXX') of the template with random characters from a predefined set to create a unique temporary filename. It ensures that the generated filename does not already exist by checking the filesystem.
template | A string containing the template for the temporary filename. The last six characters should be 'XXXXXX'. |
Definition at line 85 of file tmpname.c.
char * tmpname | ( | char * | s | ) |
Supplies a unique temporary filename.
Generates a unique temporary filename by appending the process ID and an incrementing counter to a base name. Ensures that the filename does not already exist.
s | Pointer to a buffer where the temporary filename will be stored. If NULL, the function allocates memory for the filename. |
Definition at line 34 of file tmpname.c.