| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

get_tmp_file_name

#include "sflfile.h"
char *
get_tmp_file_name (const char *path, qbyte *index, const char *ext)

Synopsis

Get a temporary file name. The filename is allocated as a fresh string, which the calling program must free when finished.

Source Code - (sflfile.c)

{
    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);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation