[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

GetTempFileName

Return the name of a temporary file.

Declaration

Source position: line 0

function GetTempFileName(

  const Dir: String;

  const Prefix: String

):String;

function GetTempFileName: String;

function GetTempFileName(

  Dir: PChar;

  Prefix: PChar;

  uUnique: DWORD;

  TempFileName: PChar

):DWORD;

Description

GetTempFileNamereturns the name of a temporary file in directory Dir. The name of the file starts with Prefix.

If Diris empty, the value returned by GetTempDiris used, and if Prefixis empty, 'TMP' is used.

The OnGetTempFilehandler may be set to provide custom handling of this routine: One could implement callbacks which take into consideration frameworks like KDE or GNOME, and return a different value from the default system implementation.

Errors

On error, an empty string is returned.

See also

GetTempDir

  

Return name of system's temporary directory

OnGetTempFile

  

Handler for GetTempFileNamefunction.