Skip to content

Commit

Permalink
now displaying the ratio of read and lost data while dar_cp is proces…
Browse files Browse the repository at this point in the history
…sing and hitting an error
  • Loading branch information
Edrusb committed Dec 31, 2024
1 parent 4748703 commit 4ee4a91
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/dar_suite/dar_cp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,26 @@ static int copy_max(user_interaction & dialog, int src, int dst)
off_t local_missed;
off_t current = lseek(src, 0, SEEK_CUR);

printf(gettext("Error reading source file (we are at %.2f %% of data copied), trying to read further: %s\n"), (float)(current)/(float)(taille)*100, strerror(errno));
printf(gettext("[%.2f %% read, %.2f %% missing] Error reading source file, trying to read further: %s\n"),
(float)(current)/(float)(taille)*100,
(float)(missed)/(float)(taille)*100,
strerror(errno));
xfer_before_error(BUF_SIZE/2, buffer, src, dst);
if(skip_to_next_readable(BUF_SIZE/2, buffer, src, dst, local_missed))
{
printf(gettext("Skipping done (missing %.0f byte(s)), found correct data to read, continuing the copy...\n"), (float)local_missed);
missed += local_missed;
printf(gettext("[%.2f %% read, %.2f %% missing] Skipping done (missing %.0f byte(s)), found correct data to read continuing the copy...\n"),
(float)(current)/(float)(taille)*100,
(float)(missed)/(float)(taille)*100,
(float)local_missed);
lu = 1;
}
else
{
dialog.message(tools_printf(gettext("Reached End of File, no correct data could be found after the last error\n")));
missed += (taille - current);
dialog.message(tools_printf(gettext("[%.2f %% read, %.2f %% missing] Reached End of File, no correct data could be found after the last error\n"),
(float)(current)/(float)(taille)*100,
(float)(missed)/(float)(taille)*100));
lu = 0;
}
}
Expand Down

0 comments on commit 4ee4a91

Please sign in to comment.