I need to calculate the size of "real" files created under a folder (and its sub-folders) on an NTFS drive, where "real" is all files that are not present because of hard/soft-links, junctions etc.

Is there currently any tool that will do this? (command-line or graphical)

More details:

I guess such a capability will be useful only under the right circumstances, so, to avoid questions due to speculations on how I "really want to use it", I'll mention my use case in advance...

I've started using pnpm and I'm trying to evaluate actual disk usage. Given that the node_modules folder (when created by pnpm) contains folders that are links to pnpm's store, I know that files in those folders should not be counted. WinDirStat seems to ignore these folders, but I need to be sure about this.

Update (2019/12/02):

It seems to be more complicated than I thought. See this issue: Add size/disk usage benchmarks.

1 Answer 1


One way to do this would be to use FSCTL_GET_NTFS_FILE_RECORD. Links are properties of the file record.

As a bonus, it will enumerate things that the dir command won't show ($MFT, $LogFile, etc).

  • Sorry, that's not a tool. Thanks anyway.
    – Doc
    Dec 2, 2019 at 8:48
  • Hmm. I suppose I could wrap a CLI around it for you. But... To enumerate all the files on disk, especially using the MFT, requires admin privileges. If I made it, would you be comfortable running it? Dec 2, 2019 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.