Revision 6ff1674f
Von Sven Schöling vor fast 13 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1237 | 1237 |
$main::lxdebug->enter_sub(); |
1238 | 1238 |
|
1239 | 1239 |
my ($self, $myconfig) = @_; |
1240 |
my $out;
|
|
1240 |
my ($out, $out_mode);
|
|
1241 | 1241 |
|
1242 | 1242 |
local (*IN, *OUT); |
1243 | 1243 |
|
... | ... | |
1319 | 1319 |
|
1320 | 1320 |
if ($template->uses_temp_file() || $self->{media} eq 'email') { |
1321 | 1321 |
$out = $self->{OUT}; |
1322 |
$out_mode = $self->{OUT_MODE} || '>'; |
|
1322 | 1323 |
$self->{OUT} = "$self->{tmpfile}"; |
1324 |
$self->{OUT_MODE} = '>'; |
|
1323 | 1325 |
} |
1324 | 1326 |
|
1325 | 1327 |
my $result; |
1326 | 1328 |
|
1327 | 1329 |
if ($self->{OUT}) { |
1328 |
open(OUT, ">", $self->{OUT}) or $self->error("$self->{OUT} : $!");
|
|
1330 |
open(OUT, $self->{OUT_MODE}, $self->{OUT}) or $self->error("error on opening $self->{OUT} with mode $self->{OUT_MODE} : $!");
|
|
1329 | 1331 |
} else { |
1330 | 1332 |
*OUT = ($::dispatcher->get_standard_filehandles)[1]; |
1331 | 1333 |
$self->header; |
... | ... | |
1398 | 1400 |
|
1399 | 1401 |
} else { |
1400 | 1402 |
|
1401 |
$self->{OUT} = $out; |
|
1403 |
$self->{OUT} = $out; |
|
1404 |
$self->{OUT_MODE} = $out_mode; |
|
1402 | 1405 |
|
1403 | 1406 |
my $numbytes = (-s $self->{tmpfile}); |
1404 | 1407 |
open(IN, "<", $self->{tmpfile}) |
... | ... | |
1412 | 1415 |
#print(STDERR "OUT $self->{OUT}\n"); |
1413 | 1416 |
for my $i (1 .. $self->{copies}) { |
1414 | 1417 |
if ($self->{OUT}) { |
1415 |
open OUT, '>', $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
|
|
1418 |
open OUT, $self->{OUT_MODE}, $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
|
|
1416 | 1419 |
print OUT $_ while <IN>; |
1417 | 1420 |
close OUT; |
1418 | 1421 |
seek IN, 0, 0; |
Auch abrufbar als: Unified diff
3-arg open: Mode für zu öffnende Pipes separat sichern
Druckvorlagen mit temporären Zwischenergebnissen werden erst mit mode ">" in
eine Temp-Datei geschrieben, und dann über die ursprüngliche Pipe ausgegeben.
Der Mode für die Datei muss dabei separat gehandhabt werden.