Skip to content

Make_Temp_File

See Also: File_Exist, Get_Directory, Make_Directory, Remove_Directory, Set_Directory, Valid_Drive

Purpose

To create a new, empty disk file.

Syntax

Make_Temp_File {temp-extension} {file-name}

where:

  • {file-name} may not be a constant or an expression.

What It Does

Make_Temp_File creates a file in the current folder with a unique name, using the specified temp-extension, and returns the unique name that was generated.

Example

In this example, a file is created with the extension tmp, and the generated root name is placed in the value of the string variable sTempFileName.

String sTempFileName
Make_Temp_File "tmp" sTempFileName

Notes

  • If, for any reason, the file cannot be created in the current folder, an error will be reported.

  • Despite the command name, the file that is created is not actually "temporary." That is, the file will not automatically self-delete at the completion of your program's execution. If you do not wish the file to remain, your program must delete it.