How to know the actual number of bytes that will be freed if I delete a directory with unsaturated hardlinks

2

I need to know the real space a directory is using in Windows. By real space I mean the number of bytes that will be freed up if I remove the directory with the Windows explorer.

In other words:

  • Directory links cannot be counted
  • Files hardlinked outside the directory (unsaturated links) cannot be counted
  • Files hardlinked inside the directory (saturated links) but not outside must be counted once only

This is different to this question because there are two different kinds of hardlinks in a directory: files hardlinked to a file outside the directory (or subdirectories) also called unsaturated hardlinks, and files hardlinked to files inside the directory (or subdirectories) also called saturated hardlinks. Tools like du.exe or ctts.exe count only one instance of saturated hardlinks and every instance of unsaturated hardlinks.

But if I remove the directory every unsaturated hardlinks will still be in the partition and won't free up space. That's the reason for not counting unsaturated hardlinks to know the real space the directory is using.

liamZ

Posted 2018-09-20T07:41:38.007

Reputation: 101

No answers