System.IOUtils.TPath.GetTempFileName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function GetTempFileName: string; static;

C++

static System::UnicodeString __fastcall GetTempFileName();

Properties

Type Visibility Source Unit Parent
function public
System.IOUtils.pas
System.IOUtils.hpp
System.IOUtils TPath

Description

Generates a unique temporary file.

Call GetTempFileName to generate a new uniquely-named temporary file. GetTempFileName actually creates a zero-sized file in a temporary location and returns its name. The caller must delete the file after it is not used anymore.

Note: GetTempFileName raises an exception if the user has no access to the system's temporary directory.

On Linux, it creates a new file which name is based on GUID in the following format: 'File_%8x%4x%4x%16x_tmp':

  •  %8x stands for GUID.D1
  •  %4x stands for GUID.D2
  •  %4x stands for GUID.D3
  •  %16x stands for GUID.D4

See Also