I tried to count blocks in 512 bytes my program's output is equivalent to the cmd du -s -l -B512 [files]. I got correct output for some directory specially those which does not have sub-dirs. But when there are several directories then I got more number if I compare with the du -s -l -B512 [files]. . code: https://pastebin.com/L2QCniY2
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.