Page 1 of 1
Calculate real directory size on HDD (no links)
Posted: 2012-12-14, 14:17 UTC
by Nux
With Windows 7 symlinks and hardlinks all over the place it's very hard to tell what the real size of the a given folder is. For example Windows directory seem to take a LOT of space while in fact there are many internal links doubling it's apparent size. I also have many links from SSD to other, bigger drives and it makes the job to optimize space even more difficult...
So the request is to be able to run dir size calculation (similar to cm_CountDirContent) omiting any hard/soft links and junctions.
Posted: 2012-12-14, 16:17 UTC
by MVV
You can open properties dialog to get Windows size w/o junctions.
But it is impossible to count size w/o hardlinks because every file hardlink is a usual file record. E.g. if file has 3 hardlinks, 2 under Windows and third under Program Files, it is a big question where to count its size because all 3 file records point to single file data...
Posted: 2012-12-14, 16:57 UTC
by Nux
MVV wrote:You can open properties dialog to get Windows size w/o junctions.
But it is impossible to count size w/o hardlinks because every file hardlink is a usual file record. E.g. if file has 3 hardlinks, 2 under Windows and third under Program Files, it is a big question where to count its size because all 3 file records point to single file data...
In this case TC should only count it where it originally is, not where it's NTFS links are. Link size is small to none so not important when one needs to know if some folder should be moved to other HDD or not.
Posted: 2012-12-14, 17:54 UTC
by MVV
Please search the board, it was discussed many times why TC counts junctions like folders.
Posted: 2012-12-14, 19:32 UTC
by Nux
MVV wrote:Please search the board, it was discussed many times why TC counts junctions like folders.
My use case is I need to know the HDD size of all sub-folders. This is my feature request. Not interested what will be default behavior.
Posted: 2012-12-14, 19:36 UTC
by Hacker
Hello
Nux,
TC should only count it where it originally is, not where it's NTFS links are.
Is there a difference between those two?
Roman
Posted: 2012-12-15, 10:17 UTC
by Nux
Hacker wrote:Hello
Nux,
TC should only count it where it originally is, not where it's NTFS links are.
Is there a difference between those two?
Roman
Example:
* You have a folder on D:\Data\Netbeans\
* The folder is mounted to: C:\Users\MyUser\AppData\Local\NetBeans\
I want to check physical size of all sub-folders in:
C:\Users\MyUser\AppData\
But I don't care about size that is taken from D.
Posted: 2012-12-15, 11:41 UTC
by Hacker
Nux,
How would you differ between data on C and data on D?
Roman
Posted: 2012-12-16, 01:02 UTC
by Nux
Hacker wrote:Nux,
How would you differ between data on C and data on D?
Roman
Code: Select all
int calculateRealDirSize(rootDir)
{
size = 0;
foreach(dir in rootDir.subdirs)
{
if (dir.isNtfsLink)
{
continue;
}
size += calculateRealDirSize(dir);
}
size += fileSize(rootDir);
return size;
}
Posted: 2012-12-16, 06:43 UTC
by MVV
Nux, as I said it was discussed already, you can use Alt+Enter to open system Properties window with size w/o counting junctions. Or maybe some plugin can count sizes in such way.
Posted: 2012-12-16, 11:00 UTC
by Lefteous
DirSizeCalc has an option to continue calculation for mount points and junctions or stopping there.
http://www.totalcmd.net/plugring/dirsizecalc.html
Posted: 2012-12-16, 15:14 UTC
by Nux
Thank you! You just saved me from witting a Python script for that

. Now I have a custom view which includes real size column.
Still would be nice to have this built in for some command or configurable. I don't see a problem really. Shouldn't be much of an effort NTFS link discovery is already there, on-demand size calculation for many files too. Just add one new configuration option (even in ini alone) and use one or two ifs.