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