mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 08:28:09 +02:00
Amicommon: Implemented GetTempDir() for all Amiga systems ('T:' as default)
git-svn-id: trunk@38393 -
This commit is contained in:
parent
2cee948b72
commit
ae184f4665
@ -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
|
||||
****************************************************************************}
|
||||
|
Loading…
Reference in New Issue
Block a user