| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflfile.h" char * get_tmp_file_name (const char *path, qbyte *index, const char *ext)
Get a temporary file name. The filename is allocated as a fresh string, which the calling program must free when finished.
{ char index_str [9], /* Formatted 8-hex digit value */ *filename = NULL; do { mem_strfree (&filename); sprintf (index_str, "%08lX", *index); if (path) filename = xstrcpy (NULL, path, "/", index_str, ".", ext, NULL); else filename = xstrcpy (NULL, index_str, ".", ext, NULL); (*index)++; } while (file exists (filename)); return (filename); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |