Hi folks ,
I am sure this can be done inside a calculated column.
This topic gives an idea how it could be done
viewtopic.php?t=18356
i'd like to replicate it like this example in from TreeSize shows:
just need to know how to grab the parent folder size ...
Calculated column with bar as % of parent folder
-
bossi
- Posts: 144
- Joined: 30 Jul 2022 11:09
- Location: Win11-latest, XYx64 latest, 4K@100%
Calculated column with bar as % of parent folder
You do not have the required permissions to view the files attached to this post.
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Calculated column with bar as % of parent folder
Code: Select all
if (<cc_isfolder>) {
$parent = gpc(<cc_item>, "component", -2, 1);
}
$foldersize = foldersize($parent, <r>);
One of my scripts helped you out? Please donate via Paypal
-
bossi
- Posts: 144
- Joined: 30 Jul 2022 11:09
- Location: Win11-latest, XYx64 latest, 4K@100%
Re: Calculated column with bar as % of parent folder
Thanks sir for helping me out .
it does the job , except in the root of a drive , propably needs an additional case for that
the code :
it does the job , except in the root of a drive , propably needs an additional case for that
the code :
Code: Select all
if (<cc_isfolder>)
{$size = foldersize(<cc_item>, "<r>");
$parent = gpc(<cc_item>, "component", -2, 1);}
else
{$size = filesize(<cc_item>);
$parent = gpc(<cc_item>, "path");}
$percentage = ($size / foldersize($parent,<r>))*200+1;// (200+1) adjusts the size of the bar
return '>draw.bar ' . $percentage \ 1. ', AA4400';You do not have the required permissions to view the files attached to this post.
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Calculated column with bar as % of parent folder
Probably because
Apart of that I wouldn't use this method, the more items in the current list, the deeper the hierarchy of folders... It would become slower and slower.
The approach of choice would be: Use Everything and query it for the necessary data (folder size storing needs to be enabled ofc)
foldersize fails if it stumbles upon non-accessible folders during scanning (e.g. System Volume Information) so you would need to exclude such folders.Apart of that I wouldn't use this method, the more items in the current list, the deeper the hierarchy of folders... It would become slower and slower.
The approach of choice would be: Use Everything and query it for the necessary data (folder size storing needs to be enabled ofc)
One of my scripts helped you out? Please donate via Paypal
-
bossi
- Posts: 144
- Joined: 30 Jul 2022 11:09
- Location: Win11-latest, XYx64 latest, 4K@100%
Re: Calculated column with bar as % of parent folder
Its rather because
But yeah . its rather slow on some directories , for my Media Disk its acceptable )
$parent returns an empty value when in the root of a disk. But yeah . its rather slow on some directories , for my Media Disk its acceptable )
what do you mean byThe approach of choice would be: Use Everything
everything sir ?-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Calculated column with bar as % of parent folder
One of my scripts helped you out? Please donate via Paypal
XYplorer Beta Club