0

I'm using Windows 8.1.

There appears to be an inconsistency. Windows states adding hardlinks to a file doesn't use much disk space, and this makes sense since you're only creating a pointer.

However, the file system doesn't reflect this. If I create a hardlink, it lists the disk space usage for that file as doubled.

If doing this only adds a pointer but the FS thinks it's doubled, then it doesn't matter how much space the file is actually using when calculating remaining disk space if what the FS thinks is only taken in consideration.

So what gives? Which is it? Which is being considered when calculating remaining disk space? Appreciated!

Wes
  • 1,183
  • 3
  • 23
  • 51
  • You should specify how you are calculating the disk space usage. – josh poley Jan 21 '15 at 21:50
  • I am highlighting the original file plus all the hardlinks and then looking at the total size in the context menu 'Properties'. – Wes Jan 21 '15 at 21:53
  • If you ask explorer.exe to give you the size of a file, it will give you the size of the file, it doesn't care if it is hard-linked. To determine disk utilization you should call `GetDiskFreeSpaceEx` or a similar API. – josh poley Jan 21 '15 at 21:58
  • My question is what explorer.exe says it is using being considered when calculating remaining disk space? Or is the disk space it is actually using being considered. Because obviously what explorer.exe says it is using is in fact wrong. – Wes Jan 21 '15 at 22:00
  • Let me rephrase. Would it take the same number of hardlinks pointing to a large image in a drive to fill up the disk space as it would had you copied that large image the same number of times? In other words does creating hard links really save disk space or is this supposed advantage a myth because the OS treats hardlinks like copies of the same file rather than just pointers? – Wes Jan 21 '15 at 22:14
  • Explorer isn't the file system. The fact that Explorer doesn't take hard links into account when calculating the total size of a group of files doesn't affect the amount of disk space available. (If you look at the properties of the drive rather than of a particular set of files, Explorer asks the file system for the *actual* amount of space used and available on the volume. Those figures are correct.) – Harry Johnston Jan 22 '15 at 01:41

1 Answers1

3

According to Harry Johnston:

"Explorer isn't the file system. The fact that Explorer doesn't take hard links into account when calculating the total size of a group of files doesn't affect the amount of disk space available. (If you look at the properties of the drive rather than of a particular set of files, Explorer asks the file system for the actual amount of space used and available on the volume. Those figures are correct.)"

This was the answer I was looking for. Thanks!

Wes
  • 1,183
  • 3
  • 23
  • 51