possible to get the parent folder of <filename>?

General discussion related to "Everything".
Post Reply
darren
Posts: 2
Joined: Sat Jan 07, 2023 5:41 pm

possible to get the parent folder of <filename>?

Post by darren »

i think the "parent:<path>" search should also have a "parent:<filename>" style behavior as well because i cannot seem to accomplish my goals. the actual goal i'm working on is finding the parent folders that contain a child folder "asdf" (exactly).

simple example

Code: Select all

c:/
    test/
        asdf/
        sub1/
            sub1.txt
        sub2/
            sub2.txt
        sub3.txt
        sub4.txt
    test2/
        sub5/
            sub5.txt
        sub6.txt
        asdf.txt
the goal is returning "test" as a result and nothing else, no false positives or subfiles listed.
  • child:asdf - returns both test and test2
  • child:asdf folder: - returns both test and test2
  • child:asdf\ - returns nothing
  • child:"asdf\" - returns nothing
child is logical but insufficient, not everything can be found this way especially when i can't guarantee the child is a folder of specific name.

maybe there's a much more complex operator that i don't know yet? any help appreciated. ultimately i'm trying to find every parent folder that has a ".git" folder in it and it's a struggle to get a neat result.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: possible to get the parent folder of <filename>?

Post by void »

Please try the wholefilename: search modifier (wfn: for short)

wfn:child:asdf
darren
Posts: 2
Joined: Sat Jan 07, 2023 5:41 pm

Re: possible to get the parent folder of <filename>?

Post by darren »

void, thank you this totally does it (obviously).

my only feedback is that i would have expected it to be child:wfn:asdf namely "the folder who has a child with wholefilename of asdf"

either way, thank you. i never would have figured this out on my own.
Post Reply