diff --git a/deep_fixitycheck.pl b/deep_fixitycheck.pl index 09221219d80ff62e4d58a0f4f66f7077a89e88d1..9704f0ad5389092cb7e14694eeabf58a28434c96 100644 --- a/deep_fixitycheck.pl +++ b/deep_fixitycheck.pl @@ -213,7 +213,8 @@ sub add_error ($$$) { my $result = shift; my $errormessage = shift; $result->{errors}++; - push @{$result->{error_description}}, "file $fileobj->{file_mounted} (original: $fileobj->{filepath}) $errormessage"; + my $report_path = $result->{report_path}; + $report_path->append_utf8( "file $fileobj->{file_mounted} (original: $fileobj->{filepath}) $errormessage"); return $result; } @@ -335,12 +336,15 @@ sub stage2 ($$$$) { chomp; my $transferrate_in_MBs = sprintf("%0.2f", $stat->{scansize} / (time - $stat->{begin} + 1) / 1024 / 1024); print $progressbar->report("parse IE files: %40b running: %L ETA: %E ($count/$cnt_unsorted_files IEs, tfr=$transferrate_in_MBs MB/s) \r", ++$count); + my $timestamp = strftime("%Y-%m-%d %H:%M:%S %z (%Z)", localtime(time)); + $report_path->append_utf8("$timestamp, IE $_ with following errors:\n"); my $ret = parse_iexml($_, $recovery); foreach my $fileobj (@{$ret->{files}}) { $fileobj->{file_mounted} = map_file($map_path, $fileobj->{filepath}); $stat->{files}++; my $result; $result->{errors} = 0; + $result->{report_path} = $report_path; $result = check_if_file_exist($fileobj, $result); if ($result->{exist}) { # only if file exists, do additional checks @@ -355,11 +359,6 @@ sub stage2 ($$$$) { } if ($result->{errors} > 0) { - my $timestamp = strftime("%Y-%m-%d %H:%M:%S %z (%Z)", localtime(time)); - $report_path->append_utf8("$timestamp, IE $_ with following errors:\n"); - foreach my $errors (@{$result->{error_description}}) { - $report_path->append_utf8("\t$errors\n"); - } $report_path->append_utf8("-" x 60, "\n"); $stat->{errors} += $result->{errors}; }