mirror of
https://github.com/claunia/dddiff.git
synced 2025-12-16 18:34:24 +00:00
Fix progress show.
This commit is contained in:
10
main.c
10
main.c
@@ -90,6 +90,11 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
in_read = read(fd_in, in_buf, block_size);
|
in_read = read(fd_in, in_buf, block_size);
|
||||||
|
|
||||||
|
printf("\rProcessing position %d of %ld (%f%%)",
|
||||||
|
0,
|
||||||
|
last_pos,
|
||||||
|
0.0);
|
||||||
|
|
||||||
while(in_read > 0)
|
while(in_read > 0)
|
||||||
{
|
{
|
||||||
current_pos = lseek(fd_in, 0, SEEK_CUR);
|
current_pos = lseek(fd_in, 0, SEEK_CUR);
|
||||||
@@ -123,6 +128,11 @@ int main(int argc, char** argv)
|
|||||||
in_read = read(fd_in, in_buf, block_size);
|
in_read = read(fd_in, in_buf, block_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("\rProcessing position %ld of %ld (%f%%)",
|
||||||
|
current_pos,
|
||||||
|
last_pos,
|
||||||
|
((float)current_pos * 100.0) / (float)last_pos);
|
||||||
|
|
||||||
close(fd_in);
|
close(fd_in);
|
||||||
close(fd_out);
|
close(fd_out);
|
||||||
free(in_buf);
|
free(in_buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user