summaryrefslogtreecommitdiff
path: root/systemunit.pas
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-10-26 11:04:50 +0100
committerErich Eckner <git@eckner.net>2015-10-26 14:40:06 +0100
commitbead677137dd9428046b2fff2ae8092439c4a152 (patch)
tree80af7b78755483a591ae233cec91194d89962582 /systemunit.pas
parentb13af1dc559902ac4f3349b6e04bc1fc5269769d (diff)
downloadunits-bead677137dd9428046b2fff2ae8092439c4a152.tar.xz
mkTemp neu in systemunit.pas
Diffstat (limited to 'systemunit.pas')
-rw-r--r--systemunit.pas19
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;