ncdu-diff icon indicating copy to clipboard operation
ncdu-diff copied to clipboard

Sizes not correctly sorted

Open mdehollander opened this issue 6 years ago • 3 comments
trafficstars

Thanks for providing this ncdu-diff tool. It makes it more easy to monitor differences in disk usage.

When we load the json file produced with the ncdu-diff python script with the patched ncdu (1.14), we see this:

   20,8 GiB [##########] ****
    2,8 GiB [#         ] ****
  139,2 MiB [          ] ****
   19,3 GiB [          ] ****

As you can see this is not correctly sorted on size. Pressing s also does not produce a correctly sorted output.

Pressing g to show the percentages shows a negative value:

 20,8 GiB [475,1%] ****
    2,8 GiB [ 63,9%] ****
  139,2 MiB [  3,1%] ****
   19,3 GiB [-442,1%]****   

Any idea why this happens? In the folder with the negative percentage there is new data added

mdehollander avatar Sep 27 '19 10:09 mdehollander

Some of your sizes are out of range of a 32-bit integer. The same problem should happen without my patch, because the relevant code is in the dirlist_sort function which uses int instead of int64_t for sizes.

lilydjwg avatar Oct 17 '19 08:10 lilydjwg

Thanks for your reply. Actually we don't see this behavior with the normal ncdu. Any suggestions how to can further test/debug this?

mdehollander avatar Oct 22 '19 12:10 mdehollander

I've done some update with regard to integer signs. Could you give the master code a try?

lilydjwg avatar Apr 13 '20 06:04 lilydjwg