HuntnGather – Diff between revs 18 and 20

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