DonationCoder.com Forum

DonationCoder.com Software => Find And Run Robot => Mouser's Zone => FARR Plugins and Aliases => Topic started by: justice on April 27, 2007, 10:12 AM

Title: Use locate32 with Farr -- outdated use plugin instead
Post by: justice on April 27, 2007, 10:12 AM
I wanted Locate32 (http://locate32.webhop.org/) 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):
[ You are not allowed to view attachments ]

 :-* :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.
Title: Re: Use locate32 with Farr
Post by: mouser on April 27, 2007, 02:14 PM
very nice  :up:
Title: Re: Use locate32 with Farr
Post by: nitrix-ud 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)
Title: Re: Use locate32 with Farr
Post by: justice on April 27, 2007, 05:04 PM
readme.txt  ;D
Title: Re: Use locate32 with Farr
Post by: lanux128 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..
Title: Re: Use locate32 with Farr
Post by: justice 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 ;)
Title: Re: Use locate32 with Farr
Post by: lanux128 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.. :)
Title: Re: Use locate32 with Farr
Post by: lanux128 on May 03, 2007, 03:16 AM
thanks justice.. now, i understand.. :up:
Title: Re: Use locate32 with Farr
Post by: Laughing Man 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!
Title: Re: Use locate32 with Farr
Post by: lanux128 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
[ You are not allowed to view attachments ]

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
[ You are not allowed to view attachments ]


edit: to include the Farr window.
Title: Re: Use locate32 with Farr
Post by: justice on July 04, 2007, 01:27 AM
o nice work. this is one of my most frequently used aliases!
Title: Re: Use locate32 with Farr
Post by: jmj 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.
Title: Re: Use locate32 with Farr
Post by: justice on July 05, 2007, 05:18 AM
No jmj it doesn't unfortunately. That would require a plugin request it here (https://www.donationcoder.com/forum/index.php?topic=8071.0). 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.
Title: Re: Use locate32 with Farr
Post by: jmj on July 05, 2007, 06:04 AM
No jmj it doesn't unfortunately. That would require a plugin request it here (https://www.donationcoder.com/forum/index.php?topic=8071.0). 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.
Title: Re: Use locate32 with Farr
Post by: mouser 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.donationcoder.com/forum/index.php?topic=8071.msg67072#msg67072)
Title: Re: Use locate32 with Farr
Post by: lanux128 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:
Title: Re: Use locate32 with Farr
Post by: lanux128 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]*)

[ You are not allowed to view attachments ]
Title: Re: Use locate32 with Farr
Post by: mouser 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:
Title: Re: Use locate32 with Farr
Post by: lanux128 on September 22, 2007, 09:27 PM
this is fantastic news.. :Thmbsup: i, for one will be awaiting this release eagerly.. :)
Title: Re: Use locate32 with Farr
Post by: Armando on September 22, 2007, 10:16 PM
This is great!!! And I wonder who this "someone" is(https://www.donationcoder.com/forum/esmileys/gen3/1Small/char067.gif)...
Title: Re: Use locate32 with Farr
Post by: Armando 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 (https://www.donationcoder.com/forum/index.php?topic=8281.msg73736#msg73736))

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???
Title: Re: Use locate32 with Farr
Post by: Darwin on September 22, 2007, 10:45 PM
I can't wait - any idea when it's going to go up?
Title: Re: Use locate32 with Farr
Post by: Okke 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
Title: Re: Use locate32 with Farr
Post by: Okke 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!
Title: Re: Use locate32 with Farr
Post by: TucknDar 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.
Title: Re: Use locate32 with Farr
Post by: nitrix-ud on September 23, 2007, 05:42 AM
amazing news !!!
this is so cool, i can't wait for your plugin !  :Thmbsup:
i feel next week is gonna be a nice one   :D
Title: Re: Use locate32 with Farr
Post by: f0dder on December 27, 2007, 08:03 AM
Just so nobody else ends up looking as stupid as me, here's the plugin (https://www.donationcoder.com/forum/index.php?topic=10501.0) :)
Title: Re: Use locate32 with Farr
Post by: lanux128 on December 27, 2007, 07:47 PM
and for other Farr plugins, check out this page: FARR Plugin Page (https://www.donationcoder.com/Software/Mouser/findrun/addons/).