HuntnGather – Blame information for rev 11
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | Short: File indexing and search utilities. |
2 | Author: Wizardry and Steamworks |
||
3 | Uploader: "Wizardry and Steamworks" <office@grimore.org> |
||
4 | Type: util/dir |
||
5 | Replaces: util/dir/HuntnGather.lha |
||
11 | office | 6 | Version: 1.7 |
1 | office | 7 | Architecture: m68k-amigaos |
8 | |||
9 | Hunt & Gather - File search and indexing utilities. |
||
10 | (or Hunt'n'Gather bro, ghetto style) |
||
11 | |||
12 | © Copyright 2021 by Wizardry and Steamworks |
||
13 | |||
14 | Released under the MIT License, all rights reserved. |
||
15 | |||
16 | -=:[ ChangeLog ]:=- |
||
17 | |||
11 | office | 18 | 20210127: |
19 | * Small retouches and make the path or pattern argument required. |
||
20 | |||
4 | office | 21 | 20210110: |
22 | * Fixes for the new pattern matching. |
||
23 | |||
3 | office | 24 | 20210109: |
25 | * Add the ability to specify the database file for all tools (-d). |
||
26 | * Perform some file checking for all tools before running. |
||
27 | * Add Amiga-style pattern matching with Hunt. |
||
28 | |||
1 | office | 29 | 20210107: |
3 | office | 30 | * Add the quiet option (-q) to the Gather tool. |
31 | * Process arguments cannonically for both Hunt & Gather. |
||
32 | * Switch to a case-insensitive search for Hunt. |
||
1 | office | 33 | |
34 | 20210105: |
||
35 | * Ensure the database is sorted for future development. |
||
36 | * Insert CTRL+C breaking of both tools for AmigaOS. |
||
37 | * Make both tools more verbose. |
||
38 | * Dot the is, dash the ts... |
||
39 | |||
40 | -=:[ Introduction ]:=- |
||
41 | |||
42 | |||
43 | Hunt and Gather are two utiltities for indexing and then searching |
||
44 | fileswithin a drive or directory designed to speed up searching files. |
||
45 | |||
46 | The Gather utility is meant to index any path and generate a search |
||
47 | database. The Hunt utility will then open the database generated by |
||
48 | Gather and look for files matching the string provided to Hunt as |
||
49 | parameter. |
||
50 | |||
51 | The utility was designed to check large collections of icons but the |
||
52 | indexing and the fast search results proved indispensable enough for a |
||
53 | self-standing program. |
||
54 | |||
55 | -=:[ Design ]:=- |
||
56 | |||
57 | Hunt and Gather are designed with constant memory usage in order to be |
||
58 | suitable for all Amiga models. Namely, the Gather utility will search |
||
59 | all files in a given path, sort the files in ascending order by using |
||
60 | an external merge sort (tailored down to a 256KiB memory limit). |
||
61 | |||
62 | Conversely, Hunt uses brute force to search for files but by reading |
||
63 | lines from the database without loading the entire database in RAM. |
||
64 | Perhaps ulterior versions of Hunt might partition the database file |
||
65 | just like Gather does and then build Tries in oder to speed up finding |
||
66 | files on the filesystem. |
||
67 | |||
68 | The project adheres to the ANSI C standard and Amiga-centric semantics |
||
69 | are compiled conditionally (in case the "___AmigaOS__" macro is |
||
70 | defined at compile time).Otherwise, Hunt & Gather should run under any |
||
71 | platform that benefits from an ANSI C compiler. |
||
72 | |||
73 | -=:[ Usage ]:=- |
||
74 | |||
3 | office | 75 | First the Gather utility is used to index a path: |
1 | office | 76 | |
77 | |||
78 | Gather RAM: |
||
79 | |||
80 | |||
81 | which will create a file in the S: directory named "gahter.db". While |
||
82 | Gather is running, the utility will display the number of indexed |
||
83 | directories and files on the command line. |
||
84 | |||
3 | office | 85 | In order to look for a file, the Hunt utility is invoked with an Amiga |
86 | search pattern: |
||
1 | office | 87 | |
88 | |||
3 | office | 89 | Hunt #?test#? |
1 | office | 90 | |
91 | |||
3 | office | 92 | in this case, "#?test#?", that will be compared to all the files indexed |
1 | office | 93 | previously by Gather. In case any of the files previously indexed by |
94 | Gather contain the term "test", then the Hunt utility will display |
||
95 | the path to the file. |
||
96 | |||
97 | -=:[ Gather ]:=- |
||
98 | |||
99 | The Gather utility takes one single parameter representing the path |
||
100 | to be indexed; for example, all the following paths are valid: |
||
101 | |||
102 | |||
103 | RAM: |
||
104 | DH0:System/ |
||
105 | |||
106 | |||
107 | When Gather runs, a database is created at "S:gather.db" by |
||
108 | overwriting the previous database. For best results, Gather should |
||
109 | run periodically and should scan a path that is most frequently |
||
110 | searched for files. |
||
111 | |||
112 | -=:[ Hunt ]:=- |
||
113 | |||
114 | Hunt is the counterpart to Gather and will search the database at |
||
115 | "S:gather.db" for files matching the terms passed to Hunt on the |
||
116 | command line. |
||
117 | |||
3 | office | 118 | For instance: |
1 | office | 119 | |
3 | office | 120 | Hunt #?test#? |
1 | office | 121 | |
122 | will search all files in the Gather database "S:gather.db" for the |
||
123 | term "test". If any file within the database partially matches the |
||
124 | term "test", then Hunt will display the path on the command line. |
||
3 | office | 125 | |
126 | Hunt uses Amiga-style pattern for matching the file names. |
||
127 | |||
128 | -=:[ Source ]:=- |
||
1 | office | 129 | |
3 | office | 130 | The project is open sourced and licensed under MIT. The source code |
131 | is included in the AmiNET release or can be checked out via subversion |
||
132 | from the Wizardry and Steamworks repository: |
||
1 | office | 133 | |
3 | office | 134 | svn co http://svn.grimore.org/HuntnGather |
135 | |||
4 | office | 136 | -=:[ Mentions ]:=- |
137 | |||
138 | The code includes a shim for "getopt" in order to process command line |
||
139 | parameters on Amiga without changing the semantics. The shim is created |
||
140 | by Daniel J. Barrett, barrett@cs.umass.edu and is available on AmiNET: |
||
141 | |||
142 | http://aminet.net/package/dev/misc/GetOpt-1.3 |
||
143 | |||
1 | office | 144 | -=:[ Contact ]:=- |
145 | |||
146 | E-Mail(tor): office@kaarvixjxfdy2wv2.onion |
||
147 | Website: https://grimore.org/amiga/hunt_and_gather |
||
148 | Website(tor): http://kaarvixjxfdy2wv2.onion |
||
149 | Discord: https://discord.gg/k9kyDsa |
||
150 |