System.IOUtils.TPath.GetTempPath

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function GetTempPath: string; static;

C++

static System::UnicodeString __fastcall GetTempPath();

Properties

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

Description

Returns the path to a directory to store temporary files. This directory is a system-managed location; files saved here may be deleted between application sessions or system restarts.

If the system running your application does not support the requested folder, or if the requested folder does not exist in the system, this function returns an empty string instead.

GetTempPath points to the following locations on the various platforms:

  • On Windows, OS X, and Linux it points to a system-wide directory.
  • On iOS and Android, it points to a user-specific, application-specific directory.
Platform Sample path
Windows XP C:\Documents and Settings\<User name>\Local Settings\Temp
Windows Vista or later C:\Users\<User name>\AppData\Local\Temp
OS X /var/folders/<random folder name>
iOS Device /private/var/mobile/Applications/<application ID>/tmp
iOS Simulator /Users/<username>/Library/Application Support/iPhone Simulator/<SDK version>/Applications/<application ID>/tmp
Android /storage/emulated/0/Android/data/<application ID>/files/tmp
Linux /tmp

See Also