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