tmpfile

Syntax

FILE* tmpfile()

Return

A file pointer to a newly opened temporary file.

Description

Creates and opens a temporary file that is deleted when the file is closed.

Example

%fml

OnFilterStart: {
  void* newfile;
  newfile = tmpfile();
  if (!newfile) {
    printf("Unable to create file.");
  }
  else {
    // Do things with file here
    fclose(newfile);
  }
  return false;
}

See Also

fopen, fclose, tmpnam