HuntnGather – Diff between revs 8 and 11

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