|
From: | Antonio Diaz Diaz |
Subject: | Re: [Bug-ddrescue] ddrescue: some minor bugs, suggestions and feature requests. |
Date: | Mon, 14 Mar 2011 19:42:43 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905 |
Daniel wrote:
I think I didn't explain it well, plus I have a much clearer understanding of the bug now (and it's very minor). So when copying non-tried blocks and the total rescued size is less than 1000000, it will sometimes display the value in bytes (the intended behavior I think?) and at other times in KiB.
Here is the relevant code (from format_num in io.cc): for( int i = 0; i < 8 && ( llabs( num ) > limit || ( llabs( num ) >= factor && num % factor == 0 ) ); ++i ) { num /= factor; p = prefix[i]; }So, as long as num is an exact multiple of factor (1000 or 1024), it will be divided and the next prefix will be used, which displays the smallest possible number of digits.
For example, it will display 100000B as 100kB, but 100001B will be left as is.
I want to share with you some scripts I wrote.
Please, send them to me. I am in the process of integrating the functionality of such scripts in ddrescuelog. Suggestions and code examples are welcome. :-)
Regards, Antonio.
[Prev in Thread] | Current Thread | [Next in Thread] |