GetTempFileNameUTF8 function
Gets a temporary file name using the specified UTF-8-encoded path and prefix.
Declaration
function GetTempFileNameUTF8(const Dir: string; const Prefix: string)
: stringArguments
Dir | Directory path for the temporary file name. |
Prefix | Prefix for the temporary file name. |
Function result
Temporary file name generated in the routine.
Description
GetTempFileNameUTF8 is a
String function used to get a
temporary file name with the specified prefix located in the specified
directory.
Dir contains the path on the local file system where the temporary
file should be located.
Prefix contains the prefix for the temporary file name. In other
words, the temporary file name must start with this sequence of characters.
GetTempFileNameUTF8 signals the OnGetTempFile event handler (when assigned) to get the value used as the temporary file name. When OnGetTempFile has not been assigned, a string is constructed using the path information in Dir and a numeric suffix to make the file name unique. For example:
/usr/tmp/TMP0.tmp
GetTempFileNameUTF8 examines the files in the specified directory to determine if a file already exists which starts with the value in Prefix. If a file is located in the directory, a numeric suffix (starting at 0) is appended to the base file name in Prefix to build a temporary file name which does not already exist in the directory.
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
