diff options
Diffstat (limited to 'systemunit.pas')
-rw-r--r-- | systemunit.pas | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/systemunit.pas b/systemunit.pas index f9a4b1a..281df6c 100644 --- a/systemunit.pas +++ b/systemunit.pas @@ -13,9 +13,13 @@ function momentanFreieCpus: int64; function belegterSpeicher: int64; function minCache: int64; function shellSubst(s: string): string; +function mkTemp(s: string): string; implementation +uses + process, lowlevelunit; + var _cpuLastUsed,_cpuLastIdle: int64; function cpuUtilization: extended; @@ -132,6 +136,21 @@ begin end; end; +function mkTemp(s: string): string; +var + args: array of string; +begin + setlength(args,0); + while s<>'' do begin + setlength(args,length(args)+1); + args[length(args)-1]:=erstesArgument(s); + end; + result:=''; + if not runCommand('/usr/bin/mktemp',args,result) then + raise exception.create('Fehler beim Ausführen von ''/usr/bin/mktemp '+s+'''!'); + result:=trim(result); +end; + begin _cpuLastUsed:=0; _cpuLastIdle:=0; |