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