README file for the Database Reader Created by Douglas M. Auclair, dauclair@hotmail.com Copyright (c) 2000, Douglas M. Auclair under the GPL (www.fsf.org/copyleft/gpl.html) DESCRIPTION =========== The situation often arises in companies with which I contract that they have a system that stores data in files, either in binary or in text format. The other situation is that their system is broken somehow, and they need to read or compare that data for a report or for debugging purposes. Now. Dylan to the rescue! The database-reader reads binary data files (currently) and outputs that information as text. To do this, one must configure it (internally) and recompile. It assumes the binary data file named on the command line is in the same directory as itself. A previous and unavailable version compared two dissimilarly-structured text data files and output difference of information. Nothing flashy here; just a tool that works well. INSTALLATION ============ $ gzip -dc database-reader.tar.gz | tar xvf - $ cd dbreader $ make USING database-reader ===================== * Included are two sample data tables that will work with the database-reader (book.dat and xml.dat). To have the application scan those files, pass in the name of the table, without the extension: $ ./database-reader xml * The app will concatenate ".dat" to the table name and print out the table's contents CONFIGURING database-reader =========================== "All well and good", I can hear you think, "but how do I get it to read my data tables?" Fortunately, this is a simple process: 1. Add your data table's meta information to the *database* table in function setup -- note that the #"column names" are the leading integer data of the record. 2. Add a do-read/print method that parses the tail end of the record -- this is where you add columns that are strings or mixed integers and strings (or single characters or bytes or booleans). 3. Recompile and go. TODO ==== Add floating-point support. ISSUES ====== As I've worked on mostly big-endian machines, this code assumes the world is big-endian. I haven't tried it on a little-endian machine. For the examples this code will work, but your database may have a reversed endian storage scheme. If you get really weird numbers, check out read-integer.