Unit 'sysutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

GetTempFileName

Return the name of a temporary file.

Declaration

Source position: osutilsh.inc line 41

function GetTempFileName(

  const Dir: string;

  const Prefix: string

):string;

function GetTempFileName: string;

function GetTempFileName(

  Dir: PAnsiChar;

  Prefix: PAnsiChar;

  uUnique: DWord;

  TempFileName: PAnsiChar

):DWord;

Description

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

If Dir is empty, the value returned by GetTempDir is used, and if Prefix is empty, 'TMP' is used.

The OnGetTempFile handler 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 GetTempFileName function.


Documentation generated on: Dec 24 2024