HuntnGather – Diff between revs 16 and 18

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