topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 10, 2024, 10:15 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: FARR search folders restriction syntax to exclude all folders?  (Read 7000 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
This may have been solved before but I didn't find it with search just now.

In FARR settings the search folders page has a field for restricting what to search in the folder.
How do we restrict the search to not show any folders? That is, the search results should show files in the specified folder and in its subfolders, but should not show the subfolders themselves.

search_folders.png

We can include file extensions with "txt;pdf;md" and exclude file extensions with "-mp4;mkv;avi".

But the on screen help text says nothing about folders. Nor does the help page https://www.donation...lp/searchfolders.htm Is there a syntax for that field to exclude folders? ( 2009 thread requested such syntax. )

I tried "-\" and "-\\" but neither worked.

If the search folder modifier keyword is used in an alias together with dosearch then one workaround is to add "-\" in the alias result line (or manually in the searchbox) to exclude folders. Or alternatively "+." to only include files. Helpfile page on that.

That workaround excludes folders, with one exception it seems: the base folder for the search folder settings is still included. For example in the screenshot above the base folder would be "C:\FARR\farr-tldr". But I noticed that if we in the alias instead add "-\\" (two slashes instead of one) then the base folder is also excluded. Though that seems undocumented behaviour.
« Last Edit: November 23, 2020, 04:39 AM by Nod5 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR search folders restriction syntax to exclude all folders?
« Reply #1 on: November 23, 2020, 03:04 PM »
hmm this is a good question.. Let me go look at the code.. If there isn't an easy way to do what you want I will add it; I was doing some little tweaks to FARR today so I can finally work on it a bit.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: FARR search folders restriction syntax to exclude all folders?
« Reply #2 on: November 23, 2020, 04:12 PM »
hmm this is a good question.. Let me go look at the code.. If there isn't an easy way to do what you want I will add it; I was doing some little tweaks to FARR today so I can finally work on it a bit.
Hi mouser, great! A bit of context: I wanted to exclude folders in this particular case because the search folder is used in an alias that also has an alias action to do "showfilehtml" (previous thread). Then folders are of no use in the results list. Or worse: FARR freezes on my PC if the "showfilehtml" action is by accident done on a folder result. Not sure if that is a general issue or something with my setup though.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: FARR search folders restriction syntax to exclude all folders?
« Reply #3 on: November 24, 2020, 03:09 AM »
I wanted to exclude folders in this particular case because the search folder is used in an alias that also has an alias action to do "showfilehtml" (previous thread). Then folders are of no use in the results list. Or worse: FARR freezes on my PC if the "showfilehtml" action is by accident done on a folder result. Not sure if that is a general issue or something with my setup though.

Answering myself, there does seem to be a general issue/bug with FARR (or IE in FARR) there. To reproduce create this alias
name: showfilehtml_test
regex: ^(h:) (.+)$
result: showfilehtml $$2
and create an empty folder "C:\testing" and type "h: C:\testing" in FARR.
FARR will show an Explorer like view of the empty folder and after a few seconds freezes. Sometimes FARR shows an error message and closes its process. Other times the FARR process must be closed manually. If this is a general thing then maybe prevent showfilehtml from acting on folders? Though still possible that this varies with some underlying IE settings.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR search folders restriction syntax to exclude all folders?
« Reply #4 on: November 24, 2020, 05:26 AM »
I would usually restrict the results of a search folder by including the -\ in the alias that utilizes the search folder, instead of the folder setting itself.
It is impossible to make anything foolproof because fools are so ingenious.