0

I made a little c++ project to print the sizes of directories and files ordened. However, I noticed that I get a difference in size for what du reports and what my program, using boost::filesystem, reports. Could anyone tell me what kind of error I might be making, I have tried looking and debugging, but I'm just not seeing it.

https://github.com/jelmew/printSIzeTree

Kind regards, Jelmew

Edit: Nautilus prints the same size as my program does.

jelmew
  • 543
  • 1
  • 7
  • 15
  • On StackOverflow everything must be in the question. I mean the minimal source code of your algorithm, expected and actual data. Remember the main goal of a question is to help other readers with the same problem. – drescherjm Apr 12 '18 at 15:11
  • Try working with just a single file and work out exactly how it differs - are you sure you're looking at size of file rather than size of file on disk? – UKMonkey Apr 12 '18 at 15:12
  • Does the filesystem have automatic compression lilke zfs or btrfs? – drescherjm Apr 12 '18 at 15:14
  • Have you tried du --apparent-size https://unix.stackexchange.com/questions/173947/du-s-apparent-size-vs-du-s – sehe Apr 12 '18 at 15:16
  • 1
    That's it. Doh, I forgot that du prints size on disk. – jelmew Apr 12 '18 at 15:17

0 Answers0