Lines 36-41
Link Here
|
36 |
my($printStats); |
36 |
my($printStats); |
37 |
($filename, $cutoffTimestamp, $printStats) = @_; |
37 |
($filename, $cutoffTimestamp, $printStats) = @_; |
38 |
|
38 |
|
|
|
39 |
#preserve timestamps and ownership of the files |
40 |
my ( $mode, $uid, $gid ) = ( stat($filename) )[ 2, 4, 5 ]; |
41 |
$mode = $mode & 07777; |
42 |
|
39 |
# Generate names for the temporary files. |
43 |
# Generate names for the temporary files. |
40 |
my($tempInputFile) = $filename . ".in"; |
44 |
my($tempInputFile) = $filename . ".in"; |
41 |
my($tempOutputFile) = $filename . ".out"; |
45 |
my($tempOutputFile) = $filename . ".out"; |
Lines 79-84
Link Here
|
79 |
|
83 |
|
80 |
# Rename our temporary output file to the original log file name. |
84 |
# Rename our temporary output file to the original log file name. |
81 |
close OUTFILE; |
85 |
close OUTFILE; |
|
|
86 |
|
87 |
#apply previous permissions and ownerships to temp file before renaming |
88 |
|
89 |
chmod $mode, $tempOutputFile; |
90 |
chown $uid, $gid, $tempOutputFile; |
91 |
|
82 |
rename $tempOutputFile, $filename; |
92 |
rename $tempOutputFile, $filename; |
83 |
|
93 |
|
84 |
# Remove our temporary input file. |
94 |
# Remove our temporary input file. |