topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday November 8, 2024, 8:54 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

Last post Author Topic: Use locate32 with Farr -- outdated use plugin instead  (Read 40797 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Use locate32 with Farr -- outdated use plugin instead
« on: April 27, 2007, 10:12 AM »
I wanted Locate32 to work with FARR but there's no document describing commandline options for the locate32 executable. after I noticed that the first word after locate32 that started with a dash lost part of the searchstring I knew I was on the right track...

After some fiddling I present you the results: If you want to search with locate32 from the command line you can use this:
locate32 keyword
(to bring up the locate window with your keyword as the search, but it does not run)
locate32 -r keyword
(to being up the locate window with search results for your keyword)
I couldn't find any documentation on any switches so I assume it's unofficial and might break in the future?? Maybe using some debug tool someone might find other switches, to search for extension for example.

To do this straight from FARR paste this as an preformatted alias group:
1000>>>locate32>->loc $$1 |C:\Program Files\Locate\Locate32.exe -r $$1>+>^loc (.*)
or create a new alias like this screenshot (change the path to locate32.exe depending on where you installed it):
locate.png

 :-* :Thmbsup:

[attach2]

BTW it shouldn't be hard to write a plugin to use the locate.exe executable to return the search results inside the FARR window, as locate.exe <keyword> does a search for keyword and returns all search results in a dosbox.
« Last Edit: January 14, 2008, 09:58 AM by justice »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Use locate32 with Farr
« Reply #1 on: April 27, 2007, 02:14 PM »
very nice  :up:

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #2 on: April 27, 2007, 02:47 PM »
FYI, i found command-line parameters in the readme.txt

6. Command line parameters for locate32


Locate32.exe has the following command line arguments:

Usage: locate32.exe [-p path] [-t type] [-d dbfile] [-r] [-u] text
    or locate32.exe -U [-rX]
    or locate32.exe -s

   text      put 'text' to 'Named field'
   -P path    put 'path' to 'Look in' field
   -p path    put 'path' to 'Look in' field (checks also that path is correct)
   -t type    put 'type' to 'Extensions' field
   -c       put clipboard content to 'Named field'
   -d file      uses database in file 'file'
   -D name      uses database named 'name'
    -Lpath         check directory path
       -L1            check all local hard drives
   -r      start locating when Locate32 is opened
   -u      start update process at start
   -U      update database
   -RX      set the priority class of process, X is 'h' (high), 'a' (above),
         'n' (normal), 'b' (below), 'i' (idle) or 'r' (realtime)
   -s       leave locate32 background when dialog is closed
   -S       start locate32 to background, (adds icon to tastbar)
   -i      start new instance
   -a       activate existing instance (use e.g. "-a2" to activate the 2nd instance)
   -lP preset   load preset      
   -ln      set number of maximum found files
   -lf      Set check field to 'File Names Only'
   -ld      Set check field to 'Folder Names Only'
   -lfd      Set check field to 'File and folder names'
   -lc text   put 'text' to 'file containing text' field
         -lcnm           uncheck 'Match case' field
         -lw             check 'Match whole name only' field
         -lwn            uncheck 'Match whole name only' field
   -lr      check 'Replace spaces with asterisk' field
   -lW      check 'Use whole path' field
   -lrn      uncheck 'Replace spaces with asterisk' field
   -lm size   set minumum file size
   -lM size   set maximum file size
   -lDmDAY     set minimum file modification date, DAY can be exact date in the
         form of YYMMDD, or number (0 is today, 1 is yesterday, etc)
   -lDcDAY     set minimum file creation date
   -lDaDAY     set minimum file last access date
   -lDMDAY     set maximum file modification date
   -lDCDAY     set maximum file creation date
   -lDADAY      set maximum file last access date
   -lsXY      sort located items where X is 'n' (sort by name),
         'f' (directory), 's' (size), 't' (type) or 'd' (modified date)
         and Y is 'a' (ascending order) or 'd' (descending order)
   -X:CUSTOM   use different settings branch (see locate.ini file)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #3 on: April 27, 2007, 05:04 PM »
readme.txt  ;D

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #4 on: May 02, 2007, 10:10 PM »
just curious, but does't Farr's and locate's functions overlap? :) but i think a plugin is the way to go, so at least one doesn't have to click on locate's search button..

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #5 on: May 03, 2007, 01:20 AM »
You don't have to click on the search button :) the alias will do that for you and just run the search without any further mouse clicks or keyboard input.
The power you get from this combination is that FARR is great in searching and displaying your common folders, but locate already has an index of your whole drive. So if you can't find it in FARR (or are looking for individual documents) then run a 'loc <document>' and the results are in the locate window. I hope that helps clear things up.

edit: ahh we're editing at the same time ;)
« Last Edit: May 03, 2007, 02:51 AM by justice »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #6 on: May 03, 2007, 02:50 AM »
you dom't have to click on the search button
really..? now, that's cool.. 8) but i still would like to know why both - Farr & locate? please enlighten this ignoramus.. :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #7 on: May 03, 2007, 03:16 AM »
thanks justice.. now, i understand.. :up:

Laughing Man

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 105
  • V for Viktor
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #8 on: May 25, 2007, 05:46 PM »
Thanks! I just recently found locate32 and finding out I can integrate it with FARR is a great finding!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #9 on: July 04, 2007, 12:53 AM »
justice, i modified this alias to include the file-type as part of search query.. tks for the ideas.. :)

Alias Tab
ws-farr_alias_locate-2.pngUse locate32 with Farr -- outdated use plugin instead

here's the preformatted version:
1000>>>locate32>->locate $$1 |C:\Program Files\Locate\Locate32.exe -r $$1>n>locate $$1 with filetype $$2 |C:\Program Files\Locate\Locate32.exe -t $$2 -r $$1>+>^loc(?:\s|)([^\s]*)(?:\s|)([^\s]*)(?:\s|)([^\s]*)(?:\s|)([^\s]*)

Farr window
ws-farr_alias_locate-0.png


edit: to include the Farr window.
« Last Edit: July 04, 2007, 12:57 AM by lanux128 »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #10 on: July 04, 2007, 01:27 AM »
o nice work. this is one of my most frequently used aliases!

jmj

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 42
  • Author of Locate32
    • View Profile
    • Locate32
    • Donate to Member
Re: Use locate32 with Farr
« Reply #11 on: July 05, 2007, 04:03 AM »
Farr window

edit: to include the Farr window.


I haven't use farr, but does that means that farr uses locate to search files and shows results in its own window? If that's so, it's quite impressive.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #12 on: July 05, 2007, 05:18 AM »
No jmj it doesn't unfortunately. That would require a plugin request it here. Would love to see that done though.

At the moment it launches locate with the query, so you get a locate32 window with the result from your farr query.

jmj

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 42
  • Author of Locate32
    • View Profile
    • Locate32
    • Donate to Member
Re: Use locate32 with Farr
« Reply #13 on: July 05, 2007, 06:04 AM »
No jmj it doesn't unfortunately. That would require a plugin request it here. Would love to see that done though.


Ok. Mouser has asked me about the database structure in Locate (I'm the author of Locate). So maybe that plugin is available someday.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Use locate32 with Farr
« Reply #14 on: July 05, 2007, 07:13 AM »
jim has been really generous with his code, and it's the first thing i'm going to study when it comes time to add optional indexing support to FARR  :up:

(see also my reply here: https://www.donation...71.msg67072#msg67072)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #15 on: July 05, 2007, 09:36 PM »
since justice sold me the idea of converging farr & locate, i'm all for it.. it looks like the indexing is the next step forward.. :Thmbsup:

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #16 on: August 27, 2007, 11:54 PM »
i modified justice's alias a bit but now i seem to have a problem but lack the know-how to correct it. the alias' syntax is "loc <keyword>" but now if i want to search for something that's say "local" then it's broken into "loc al".. so i'm posting here in the hope that some regex expert can help me out.. :)

here is the alias:
1000>>>locate32>->locate $$1 |C:\Program Files\Locate\Locate32.exe -r $$1>n>locate $$1 with filetype $$2 |C:\Program Files\Locate\Locate32.exe -t $$2 -r $$1>+>^loc(?:\s|)([^\s]*)(?:\s|)([^\s]*)(?:\s|)([^\s]*)(?:\s|)([^\s]*)

ws-locate-2.png

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Use locate32 with Farr
« Reply #17 on: September 22, 2007, 08:51 PM »
anyone who has been hoping for better farr interaction with locate needs look no further.  someone has just made a proper locate plugin for farr that is quite extraordinary and works wonderfully.

the really amazing thing on top of it's functionality is that the plugin was written in Delphi -- which is no small feat since all of the supporting helper code i wrote for farr plugin api was in c++, so he had to recreate a bunch of stuff in delphi. 

very impressive but the real sweet icing on the cake is that now anyone who wants to can use delphi to make a farr v2 plugin by starting with his skeleton code and just customizing a couple of functions.

i can't wait till he posts it  :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup:

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #18 on: September 22, 2007, 09:27 PM »
this is fantastic news.. :Thmbsup: i, for one will be awaiting this release eagerly.. :)

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #19 on: September 22, 2007, 10:16 PM »
This is great!!! And I wonder who this "someone" is...

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #20 on: September 22, 2007, 10:23 PM »
i modified justice's alias a bit but now i seem to have a problem but lack the know-how to correct it. the alias' syntax is "loc <keyword>" but now if i want to search for something that's say "local" then it's broken into "loc al".. so i'm posting here in the hope that some regex expert can help me out.. :)

here is the alias:
1000>>>locate32>->locate $$1 |C:\Program Files\Locate\Locate32.exe -r $$1>n>locate $$1 with filetype $$2 |C:\Program Files\Locate\Locate32.exe -t $$2 -r $$1>+>^loc(?:\s|)([^\s]*)(?:\s|)([^\s]*)(?:\s|)([^\s]*)(?:\s|)([^\s]*)
(see attachment in previous post)

By the way, Lanux, I'm no expert but this is what I'd do:

Group Alias Name: "locate32" (I use quotes in all my custom aliases names to avoid triggering them by their name)
RegEx Pattern (optional) : ^loc (.*)
(with a space after ^loc)
Wouldn't that work???

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #21 on: September 22, 2007, 10:45 PM »
I can't wait - any idea when it's going to go up?

Okke

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 26
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #22 on: September 23, 2007, 02:35 AM »
Lol Armando, love the "head in the bag" icon. It actually almost looks like me ;)

Hi everyone,

Mouser was talking about me. He's so enthousiastic but I'm still in "hopefully I didn't do any stupid things or forgot something mode"
since it's the first plugin I've written, hadn't touched Delphi in years and have been using FARR only since latest beta.

I wanted to write plugins for FARR but really don't like using C++ so decided to use Delphi instead. I had to convert the C++ framework
to Delphi. To test the framework I decided to make a simple plugin which was actually useful. This ended up being a Locate32 plugin.
Maybe the locate32 integration could have been done differently as well since I'm just learning about the more complex things in FARR
but it works very well for me. Hopefully others enjoy it as well.

I'll try working with Mouser and get it released today or tomorrow.


Below are some usage details for people who like to know how it works. The used options
are from locate itself (locate.exe /?). In the Adv Configuration of the plugin you'll be able
to set the location of locate.exe and the maximum found files (sames as -ln:<number> option).
You can overrule that maximum if you use the -ln:<number> in the search if you don't want
to change it in the adv config.

Some examples for searching:

// Search for notepad in c:\windows, don't search subdirectories, extension has to be exe
loc -t exe -Rn -p c:\windows notepad

// Search for java with minimum creationdate 21 sept 2007 and extension pdf
loc -t pdf -lDc070921 java

// Search for v[a-z]deo, find only directories, treat as regular expression (-r), use path d:\  (-p d:\), don't look in subdirectories (-Rn)
// in my case this found d:\Video
loc -ld -r -p d:\ -Rn v[a-z]deo

Hopefully it's useful to everyone. Btw, if anyone has suggestions, tips or anything else, please yell. I'm not a Delphi developer (I normally
program in Java, Python and others) so there could be things in the framework code as well that could be better. Don't hesitate to
make comments, I like to learn from my mistakes :)

And Mouser, thanks for all the help and for being a great friendly host!  :Thmbsup:

Regards,

Okke

Okke

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 26
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #23 on: September 23, 2007, 03:26 AM »
I just read some other posts and just to be clear, the plugin returns the results in the FARR results window.
It uses the locate.exe commandline executable to return the results and shows them inside FARR :). FARR itself
handles the execution. If locate returned the directory you can browse it in FARR as well and so on.

Btw jmj, thanks for writing such an excellent searchtool!! It's amazingly fast and works great together with FARR!

TucknDar

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,133
    • View Profile
    • Donate to Member
Re: Use locate32 with Farr
« Reply #24 on: September 23, 2007, 04:45 AM »
Excellent news, Okke! And welcome to DC :)

Will be fun to play with your plugin, and I love the fact that now I can have the locate results within the FARR window. :up:

Although I can't do any programming myself, it's also cool to hear that you've opened the FARR Plugin door to Delphi programmers as well.