topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 5:37 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: bug: launch history bypass search directory file restrictions?  (Read 4315 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Bug replicated with these settings:

ALIAS:
^b (\w.*)[^\+]$
C:\aaa $$1 | dosearch +aaa $$1

SEARCH DIRECTORY:
path: C:\aaa
restrictions: -txt;url;jpg
modifier keyword: aaa

Given that then entering "b test" in FARR should match C:\aaa\test.png but not C:\aaa\test.txt . But if the user has previously launched C:\aaa\test.txt then FARR seems to ignore the set restriction and displays C:\aaa\phrase.txt among the alias matches. FARR does not include other matching .txt files (like  C:\aaa\test2.txt ) until such other files also have been launched by FARR once.

(background: the last part of the regex -- [^\+]$ -- is there to disable this alias by adding "+" to the end of the search phrase and then immediately let another alias -- ^b (\w.*)\+$  -- search the same folder but without the restrictions, using another search directory modifier. If I get this problem sorted out then that will be a very handy way to have an alias toggle between limited/full search within some folders)
« Last Edit: August 20, 2009, 04:46 PM by Nod5 »

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: bug: launch history bypass search directory file restrictions?
« Reply #1 on: August 21, 2009, 04:49 PM »
You could always restrict file types in the alias instead of the search folder definition. The problem, as I see it, is that previously launched .txt file is added to launch history which is then evaluated in later searches. But then it is filtered only by entered search string (and not by search folder definition) and is therefore not excluded from the results as it should be.

Alias:
^b (\w.*)[^\+]$
C:\aaa $$1 | dosearch +aaa -.txt $$1

Search directory:
path: C:\aaa
restrictions: url;jpg
modifier keyword: aaa
It is impossible to make anything foolproof because fools are so ingenious.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: bug: launch history bypass search directory file restrictions?
« Reply #2 on: August 22, 2009, 08:13 AM »
my alias doesn't work at all when I add "-.txt".
edit: I accidentally unticked the alias box.  :D Works now. In the alias the file restrictions need to be individual, like so:
C:\aaa $$1 | dosearch +aaa -.txt -.jpg -.url $$1

A problem: the restriction excludes any file containing ".txt" in extension OR name. So both "file.txt.pdf" and "file.txt" are excluded. To avoid that we'd need some way to specify the restriction. Compare: in regexp $ marks the end of the string so ".txt$" would do the trick there.
« Last Edit: August 22, 2009, 08:27 AM by Nod5 »

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: bug: launch history bypass search directory file restrictions?
« Reply #3 on: August 22, 2009, 08:35 AM »
A problem: the restriction excludes any file containing ".txt" in extension OR name. So both "file.txt.pdf" and "file.txt" are excluded. To avoid that we'd need some way to specify the restriction. Compare: in regexp $ marks the end of the string so ".txt$" would do the trick there.
Regex support in the search string would solve this easily. Though, I am not sure if it is really that needed.
It is impossible to make anything foolproof because fools are so ingenious.
« Last Edit: August 22, 2009, 08:51 AM by skajfes »

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: bug: launch history bypass search directory file restrictions?
« Reply #4 on: August 22, 2009, 04:19 PM »
Right, I have no need for it ATM so I shouldn't call it a problem really. The aliases works as I hoped for now so all is well.