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