Creates a name for a temporary file. If a unique file name is generated, an empty file is created; otherwise, only a file name is generated.
DWORD GetRtTempPath( LPCSTR lpPathName, LPCSTR lpPrefixString, UINT uUnique, LPSTR lpTempFileName );
lpPathName [in]
lpPrefixString [in]
uUnique
lpTempFileName
The call looks for the environment variable "TMP" and returns its value. If that value is not present it next tries the variable "TEMP".
If the function succeeds, the return value specifies the unique numeric value used in the temporary file name. If the uUnique parameter is nonzero, the return value specifies that same number. If the function fails, the return value is zero. To get extended error information, call GetLastRtError.
Possible extended return values include:
Value | Description |
---|---|
E_PARAM | One or both of lpPathName or lpPrefixString was NULL. |
E_LIMIT | The length of the string pointed to by the lpPathName parameter is more than MAX_PATH–16 characters. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 5.2 | intime/rt/include/rtbase.h | rt.h | rt.lib |