[Suggestion] Add $parent-size:

Discussion related to "Everything" 1.5 Alpha.
Post Reply
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

[Suggestion] Add $parent-size:

Post by NotNull »

I was trying to create an Everything version of TreeSize and the like, butr ran into a missing $parent-size:
Now $parent-size: is technically speaking not a property of a file or folder (and probably be slightly expensive to keep up with), but would be cool if this was possible.
Would look similar to the screenshot below if functioning (first attempt):

2024-04-12 23_36_59-Percent of Parent - C__Windows - Everything (1.5a) 1.5.0.1371a (x64).png
2024-04-12 23_36_59-Percent of Parent - C__Windows - Everything (1.5a) 1.5.0.1371a (x64).png (95.82 KiB) Viewed 1384 times

Query used:

Code: Select all

addcol:A A-label:="Percent of Parent" A:=LEFT(REPT("|",25),EVAL(25*$size:/31606003309))LEFT(REPT(".",25),EVAL(25-25*$size:/31606003309))

(where 31606003309 is the size of the parent, C:\Windows)


Just something for the cool-factor :D
(definitely not a must-have)
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

I'll add parent-size and root-size properties.

Thank you for the suggestion.
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

I was trying to replicate NotNull's suggestion using column formula like this:

Code: Select all

addcolumn:a:1 a-label:="tmpSize" a:=getproperty($path:,"size")
but I was amazed because it was not working, even though Everything knows "$path:"'s size (it is visible in the "Size" column), but still it fails.
What am I missing?

Thank you.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

Ran into this too.
get-property (formula as well as preprocessor function) works only on files, not folders.
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

NotNull wrote: Sat Apr 13, 2024 9:17 am Ran into this too.
get-property (formula as well as preprocessor function) works only on files, not folders.
@NotNull
Then why are you satisfied with only "$parent-size:"?
Wouldn't it be more generalized if get-property (formula as well as preprocessor function) was improved? :D
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

My reasoning (which might be flawed):

get-property() retrieves properties of items. Those are the properties as known by the system (= Windows), like Author or Size.
This does not include Everything-specific properties, like Run Count or Folder Size.

Some of these Everything-specific properties are available throughh $<property>: , like $runcount:
Adding $parent-size: to them seemed more in line with the current setup.
reitwal
Posts: 21
Joined: Sat Apr 09, 2016 9:19 am

Re: [Suggestion] Add $parent-size:

Post by reitwal »

a:=getproperty($path:, "size") works in versions 1360a to 1366a, but not in the newer versions.

But of course "$parent-size:" would be the better solution.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

Nice find reitwal! Maybe it was intended to work that way after all ...
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

My reasoning of why improving "get-property" is better than adding "$parent-size:":

"$runcount:" cannot be derived from formula. No mathematics or simple tricks can derive "run-count:", thus, it should be kept as a property. On the other hand, you can derive "$parent-size:" from formula (some mathematics or simple tricks only needed). But still if you want to add "$parent-size:" then shouldn't it make Everything property-system clutter? Moreover, people may then ask, please add "$parent-descendant-count:", "$parent-descendant-folder-count:", "$parent-date-modified:", "$parent-date-created:", etc. Then developer has to add everything that a user can do with a simple formula into the property-system. Thus, this non-generalized way is inconvenience for both user and developer. Also, what is the use of putting much effort into developing the formula system, if formula derivable properties should also be added?

Also note that, "Percent of Parent" concept is a nice thing mentioned, I just wanted to do it in a more generalized way.

Thank you.
nikov
Posts: 131
Joined: Fri Dec 24, 2021 10:31 am

Re: [Suggestion] Add $parent-size:

Post by nikov »

Yes, nice find reitwal,

I have checked the followings only in version 1366a. And they all work. The only problem I found till now in version 1366a regarding this is: If the properties are non-indexed, they are very slow but they should not be very slow because without formula Everything can retrieve them very fast.

Properties checked:

Code: Select all

addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"size")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"date-modified")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"date-created")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"descendant-count")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"descendant-file-count")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"descendant-folder-count")
addcolumn:a:1 a-label:="tmpClmn" a:=getproperty($path:,"attributes")
Thank you.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

nikov wrote: Sat Apr 13, 2024 8:20 pm But still if you want to add "$parent-size:" then shouldn't it make Everything property-system clutter? Moreover, people may then ask, please add "$parent-descendant-count:", "$parent-descendant-folder-count:", "$parent-date-modified:", "$parent-date-created:", etc. Then developer has to add everything that a user can do with a simple formula into the property-system.
My thoughts exactly. In fact: put to words here (first part of the post).

However, $parent-size: is the more human-friendly way, which seems the preferred way in Everything.
The "go with the flow" approach seems to me the easiest to implement too.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: [Suggestion] Add $parent-size:

Post by NotNull »

NotNull wrote: Sat Apr 13, 2024 10:01 pm $parent-size: is the more human-friendly way,
On second (third?) thought: the amount of 'humans' that has a need for $parent-size is probably *very* limited.
If get-property() will support $path again in the future, that should suffice (IMO)
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: [Suggestion] Add $parent-size:

Post by void »

I am working on getproperty()
Ideally, getproperty() should get the indexed value if it exists..



For now, the following should work:

getproperty($path:,"totalsize")
Post Reply