A function suggestion similar to childfilecount but with full path depth

Have a suggestion for "Everything"? Please post it here.
Post Reply
Mizufluffy
Posts: 62
Joined: Sun Jun 13, 2021 10:22 am

A function suggestion similar to childfilecount but with full path depth

Post by Mizufluffy »

I recently tried File List Slots because it let me have a set of predetermined list of folders. My idea was then to find those folders that would contain a certain number of files regardless of the path depth. Normally I would use childfilecount: for something similar to this but in this case it won't work because that function counts files that are directly in the given folder.

What I'd like to see is something similar to

Code: Select all

files: path:"path/to/folder"
and then count those files.

I'll give an example.

Code: Select all

Folder A
   - 0 subfolders
   - 15 files
Folder B
   - Folder B1
      - 0 subfolders
      - 5 files
   - Folder B2
      - 0 subfolders
      - 5 files
Folder C
   - 10 files
   - Folder C1
      - 0 subfolders
      - 5 files
Folder D
   - 0 subfolders
   - 8 files
So, these Folder A through D are added in a filelistx:

If I did the following search:

Code: Select all

filelist0: childfilecount:<12

then I'd get Folder B (0 files), Folder C (10 files) and Folder D (8 files). However, in this case I'd like to find Folder B (10 files) and Folder D (8 files) but exclude Folder A (15 files) and Folder C (15 files).

In conclusion, I'd love to have a function that is similar to childfilecount: but counts all files similar to following search: files: path:"path/to/folder"

If someone already knows a way to do this then that would also be cool but a dedicated function might be easier to use.
void
Developer
Posts: 17161
Joined: Fri Oct 16, 2009 11:31 pm

Re: A function suggestion similar to childfilecount but with full path depth

Post by void »

I'm not sure if it's what you want, but please try
descendant-count: or descendant-file-count:

In Everything, descendant == children and grandchildren.

For example:
descendant-file-count:<12
Mizufluffy
Posts: 62
Joined: Sun Jun 13, 2021 10:22 am

Re: A function suggestion similar to childfilecount but with full path depth

Post by Mizufluffy »

Oh, wow. That's exactly what I want. I just tried it and it is indeed working how I wanted.
I usually look through Help > Search Syntax because the list is short enough, however, I'm aware that under Search > Insert Function... there is this extended list of functions in 1.5a but it's still work in progress and examples and descriptions are in TODO state. Although, I'll admit I should have found descendantfilecount: if I had used the search bar in the Select Function list and looked for something like "count" or "filecount".

Anyway, thanks for reply. I appreciate it. Good to know that the feature is already there. :D
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: A function suggestion similar to childfilecount but with full path depth

Post by raccoon »

void wrote: Wed Oct 20, 2021 10:26 amdescendant-count: or descendant-file-count:
Are there columns for descendant-count?
Mizufluffy
Posts: 62
Joined: Sun Jun 13, 2021 10:22 am

Re: A function suggestion similar to childfilecount but with full path depth

Post by Mizufluffy »

raccoon wrote: Wed Oct 20, 2021 4:38 pmAre there columns for descendant-count?
At least in the 1.5a when right clicking column title area and then Add Columns... you can find it on the list.
2021-10-20 19_53_54-path__c__temp_ folder_ - Everything (1.5a) 1.5.0.1280a (x64).jpg
2021-10-20 19_53_54-path__c__temp_ folder_ - Everything (1.5a) 1.5.0.1280a (x64).jpg (162.2 KiB) Viewed 6512 times
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: A function suggestion similar to childfilecount but with full path depth

Post by raccoon »

Ah, ty. I forgot about that.
Post Reply