HuntnGather – Diff between revs 1 and 2

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