unlink("$f->[1]") if (-e "$f->[1]");
}
}
- if ($last_parsed && -e $tmp_last_parsed) {
- unlink("$tmp_last_parsed");
+ if ($last_parsed && -e "$TMP_DIR/$tmp_last_parsed") {
+ unlink("$TMP_DIR/$tmp_last_parsed");
}
if ($last_parsed && -e "$last_parsed.tmp") {
unlink("$last_parsed.tmp");
# Automatically set parameters with incremental mode
if ($incremental) {
+
# In incremental mode an output directory must be set
if (!$outdir) {
die "FATAL: you must specify an output directory with incremental mode, see -O or --outdir.\n"
# Get last line parsed from all process
if ($last_parsed) {
- if (open(IN, "$tmp_last_parsed") ) {
+ if (open(IN, "$TMP_DIR/$tmp_last_parsed") ) {
while (my $line = <IN>) {
chomp($line);
my ($d, $p, $l) = split(/\t/, $line, 3);
}
close(IN);
}
- unlink("$tmp_last_parsed");
+ unlink("$TMP_DIR/$tmp_last_parsed");
}
# Save last line parsed
# Save last line into temporary file
if ($last_parsed && scalar keys %last_line) {
- if (open(OUT, ">>$tmp_last_parsed")) {
+ if (open(OUT, ">>$TMP_DIR/$tmp_last_parsed")) {
flock(OUT, 2) || return $getout;
$last_line{current_pos} ||= 0;
print OUT "$last_line{datetime}\t$last_line{current_pos}\t$last_line{orig}\n";
close(OUT);
} else {
- &logmsg('ERROR', "can't save last parsed line into $tmp_last_parsed, $!");
+ &logmsg('ERROR', "can't save last parsed line into $TMP_DIR/$tmp_last_parsed, $!");
}
}