Amicommon: Implemented GetTempDir() for all Amiga systems ('T:' as default)

git-svn-id: trunk@38393 -
This commit is contained in:
marcus 2018-03-01 18:04:40 +00:00
parent 2cee948b72
commit ae184f4665

View File

@ -33,6 +33,7 @@ interface
{$DEFINE OS_FILESETDATEBYNAME}
{$DEFINE HAS_SLEEP}
{$DEFINE HAS_OSERROR}
{$DEFINE HAS_TEMPDIR}
{OS has only 1 byte version for ExecuteProcess}
{$define executeprocuni}
@ -917,6 +918,23 @@ begin
end;
function GetTempDir(Global: Boolean): string;
begin
if Assigned(OnGetTempDir) then
Result := OnGetTempDir(Global)
else
begin
Result := GetEnvironmentVariable('TEMP');
if Result = '' Then
Result:=GetEnvironmentVariable('TMP');
if Result = '' then
Result := 'T:'; // fallback.
end;
if Result <> '' then
Result := IncludeTrailingPathDelimiter(Result);
end;
{****************************************************************************
Initialization code
****************************************************************************}