HuntnGather – Rev 1
?pathlinks?
Short: File indexing and search utilities.
Author: Wizardry and Steamworks
Uploader: "Wizardry and Steamworks" <office@grimore.org>
Type: util/dir
Replaces: util/dir/HuntnGather.lha
Version: 1.0
Architecture: m68k-amigaos
Hunt & Gather - File search and indexing utilities.
(or Hunt'n'Gather bro, ghetto style)
© Copyright 2021 by Wizardry and Steamworks
Released under the MIT License, all rights reserved.
-=:[ ChangeLog ]:=-
20210107:
* Add the quiet option (-q) to the Gather tool.
* Process arguments cannonically for both Hunt & Gather.
* Switch to a case-insensitive search for Hunt.
20210105:
* Ensure the database is sorted for future development.
* Insert CTRL+C breaking of both tools for AmigaOS.
* Make both tools more verbose.
* Dot the is, dash the ts...
-=:[ Introduction ]:=-
Hunt and Gather are two utiltities for indexing and then searching
fileswithin a drive or directory designed to speed up searching files.
The Gather utility is meant to index any path and generate a search
database. The Hunt utility will then open the database generated by
Gather and look for files matching the string provided to Hunt as
parameter.
The utility was designed to check large collections of icons but the
indexing and the fast search results proved indispensable enough for a
self-standing program.
-=:[ Design ]:=-
Hunt and Gather are designed with constant memory usage in order to be
suitable for all Amiga models. Namely, the Gather utility will search
all files in a given path, sort the files in ascending order by using
an external merge sort (tailored down to a 256KiB memory limit).
Conversely, Hunt uses brute force to search for files but by reading
lines from the database without loading the entire database in RAM.
Perhaps ulterior versions of Hunt might partition the database file
just like Gather does and then build Tries in oder to speed up finding
files on the filesystem.
The project adheres to the ANSI C standard and Amiga-centric semantics
are compiled conditionally (in case the "___AmigaOS__" macro is
defined at compile time).Otherwise, Hunt & Gather should run under any
platform that benefits from an ANSI C compiler.
-=:[ Usage ]:=-
First the Gather utility is used to index a path:
Gather RAM:
which will create a file in the S: directory named "gahter.db". While
Gather is running, the utility will display the number of indexed
directories and files on the command line.
In order to look for a file, the Hunt utility is invoked with a search
term:
Hunt test
in this case, "test", that will be compared to all the files indexed
previously by Gather. In case any of the files previously indexed by
Gather contain the term "test", then the Hunt utility will display
the path to the file.
-=:[ Gather ]:=-
The Gather utility takes one single parameter representing the path
to be indexed; for example, all the following paths are valid:
RAM:
DH0:System/
When Gather runs, a database is created at "S:gather.db" by
overwriting the previous database. For best results, Gather should
run periodically and should scan a path that is most frequently
searched for files.
-=:[ Hunt ]:=-
Hunt is the counterpart to Gather and will search the database at
"S:gather.db" for files matching the terms passed to Hunt on the
command line.
For instance:
Hunt test
will search all files in the Gather database "S:gather.db" for the
term "test". If any file within the database partially matches the
term "test", then Hunt will display the path on the command line.
-=:[ Mentions ]:=-
My boss spilled the data of 800+ employees.
I called him out and left.
Supporting Romania is like giving a gun to a monkey.
-=:[ Contact ]:=-
E-Mail(tor): office@kaarvixjxfdy2wv2.onion
Website: https://grimore.org/amiga/hunt_and_gather
Website(tor): http://kaarvixjxfdy2wv2.onion
Discord: https://discord.gg/k9kyDsa