The Gnucash database?

Jean-David Beyer jdbeyer at exit109.com
Sat Jul 24 13:20:53 EDT 2004


Jack Gates wrote:
> Through out this thread people have been talking about Flat Files and it has 
> been stated that there are different meanings of flat files.
> 
> My question is what is a flat file as opposed to what?  Flat File and ______ 
> file.
> 
> Thanks for any explanations,
> 
I am sure it depends to whom you speak. Were I to store this email body in 
a plain UNIX file, _I would call that flat_. Though if you include the 
whole thing, there is structure in it; i.e., it starts with headers that 
must be in the proper form. If you consider the file it really is in, that 
is a flat file to some (just a string of bytes that you can actually read 
in a simple text editor), but it has a lot of structure in it from which 
you can infer where one e-mail ends and the next begins. So someone else 
could validly call it a structured file.

Now were someone to maintain file system like DEC did once, that would be 
a structured file. Their hardware could read and write 512-byte blocks, so 
their file system had a table of contents at the front with (name, block 
number) pairs that pointed to the first block of a file. Each block had, 
IIRC, up to 510 bytes of data and the two-byte block number of the next 
block in the file. That happens to stink, but it is not a flat file from 
the point of view of the implimentor. The user might think of it as flat, 
though, just a stream of bytes is presented to the application.

More complex files are created with network model databases, where each 
record has a pointer to the "next" and "previous" record, where there may 
be multiple next and previous pointers depending on the structure of the 
data. For example, a telephone directory might have "name" pointers that, 
if followed would get the records in alphabetical order, and "number" 
pointers that, if followed, would get the records in telephone number 
order. Such a file would not be called flat.

-- 
   .~.  Jean-David Beyer           Registered Linux User 85642.
   /V\                             Registered Machine   241939.
  /( )\ Shrewsbury, New Jersey     http://counter.li.org
  ^^-^^ 13:10:01 up 7 days, 22:51, 5 users, load average: 4.12, 4.13, 4.10



More information about the gnucash-user mailing list