Text Search Utitlity Beta3.1 (03-25-01) by Jonathan Harm(110983@lycos.com) http://change.to/opensource How to use the Text Search Utility. When it asks for the directory name to search, type the full path to the directoy of your choice. If you are using a DOS or Windows based system, be sure to include the drive letter too i.e. c:\myfiles\text\ An Easier way to do this is to run the program in a ms-dos prompt window, or a console program in KDE or Gnome if you are running Linux, you can click and drag a folder into the window and then you wont have to type it in. Then it will ask if you want your search to be case insensitive. Enter "y" for yes or "n" for no. If you just press enter or press a letter other than "y" or "n", then it will search using case sensitive. So far I've only tested this with text files, but it should work with .doc files and anything else that is just plain text. It only works in directories that don't have sub directories. If you are searching through a lot of files (I tested it with about 400 files), it may take a few seconds, or minutes to search, that is depending on the file sizes and the speed of your machine. version history ---------------------- alpha 0.0.1 Jan 4, 2001 I've successfully compiled version 0.0.1 using Borland C++ 3.1 This program will search the text file and will output a number. The number is the output of strstr(). I haven't done too much testing so I am not sure how well it works. I tried compiling it in Linux(I use TurboLinux Workstation 6.0) with GCC and recieved some warnings. So there is not a stable Linux version yet. ---------------------- alpha 0.0.2 Jan 8, 2001 The next alpha version 0.0.2 code is here. It uses readdir to get the list of filenames. It isn't working yet, but I'm still working on it. ---------------------- alpha 0.0.3 Jan 16, 2001 Alpha 0.0.3 is done! and it will finally open the files in the directory that you specify. Since I haven't written any documentation on this yet, here's a tip: when entering the directory name, type in the FULL path (i.e. c:\text\myfiles\work). I still haven't got the search to work, I think it is a buffer problem. ---------------------- alpha 0.0.4 IN PROGRESS... Jan 17, 2001 I'm pretty sure the buffer problem is fixed now. I am still having problems with the searching, it displays that the search was found in every file when in fact wasn't. ---------------------- alpha 0.0.5 Jan 18, 2001 I was wrong about the buffer, so I am trying a different approach. I got a "Null pointer assignment" error when I tried to use fscanf() to get the characters in the buffer. So I used fgetc() instead and don't get the error now. It compiles with no errors or warnings in Borland C/C++ 3.1, but strstr() is returning a value other than NULL even when searching for text that is not even in any of the files being searched. strstr is on line 88. UPDATE Jan 20, 2001 I changed some code and it seems to be working better, but the while(ptr_success == NULL) loop still needs some work and that will be done in alpha 0.0.6. ---------------------- alpha 0.0.6 Jan 21-22, 2001 This has some more stuff, and a lot of printf statements to help with debugging. --------------------- alpha 0.0.7 Jan 22, 2001 Since this one actually works, it is going to be the last alpha version. I cleaned up the code a bit in this version, took out all the debugging printf statements and made a DOS executable of it. --------------------- beta 1 Jan 24, 2001 First I will say that I am ahead of schedule and will probably only release a few beta versions before I release version 1. This is a major improvement over the older versions. You can now do case insensitive searches. I also took out the line that prints what files the search was not found in. --------------------- beta 2 Mar 8, 2001 I decided to add a couple of features that were needed. Now when you search, it will pause when the screen is filled up with results. Another feature I added that isn't really necessary is when it is done searching, it tells you how many files your search was found in. --------------------- beta 3 Mar 24, 2001 Has a new feature that lets you save the directory to search. That means you can have a default directory and you don't have to enter a directory name every time you run the program. Two more things were added. One is the use of ifdef and endif to compile code for windows or Linux. The other thing is some code to change to the drive that the user specified in the path(windows only of course!). --------------------- beta3.1 Mar 25, 2001 Fixed a bug in beta3 that wouldn't properly save the location to search. Took out two printf statements that were used for debugging. --------------------- Things to look foward to in future versions: -search in sub directories of directories -search boolean style(AND and OR) -the source code split into modules for Linux -some other stuff I will think of later EOF