Revision ab183c9f
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
SL/System/TaskServer.pm | ||
---|---|---|
10 | 10 |
|
11 | 11 |
use File::Slurp; |
12 | 12 |
use File::Spec::Functions qw(:ALL); |
13 |
use File::Temp qw(tempfile);
|
|
13 |
use File::Temp; |
|
14 | 14 |
|
15 | 15 |
use SL::System::Process; |
16 | 16 |
|
... | ... | |
82 | 82 |
sub _run_script_command { |
83 | 83 |
my ($self, $command) = @_; |
84 | 84 |
|
85 |
my ($fh, $file_name) = tempfile(); |
|
86 | 85 |
my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl'); |
86 |
my $temp_file = File::Temp->new; |
|
87 |
my $file_name = $temp_file->filename; |
|
87 | 88 |
|
88 |
system "${exe} ${command} >> ${file_name} 2>&1";
|
|
89 |
$temp_file->close;
|
|
89 | 90 |
|
90 |
$fh->close;
|
|
91 |
system "${exe} ${command} >> ${file_name} 2>&1";
|
|
91 | 92 |
|
92 | 93 |
$self->last_command_output(read_file($file_name)); |
93 | 94 |
|
Auch abrufbar als: Unified diff
TaskServer-Steuerung: Temp-Datei automatisch entfernen lassen