comp.lang.ada
 help / color / mirror / Atom feed
From: wdl39!mab@ford-wdl1.arpa  (Mark A Biggar)
Subject: Re: Representation clauses
Date: 3 Jun 93 20:24:47 GMT	[thread overview]
Message-ID: <1993Jun3.202447.11641@wdl.loral.com> (raw)

[problem with rep clauses and variant records and binary IO]

Seriously consider not doing your record IO in binary at all.
Write out each record as a line of ascii text with binary values
output in formated ascii.  This has 3 major advantages.

1) It is completely portable, even between programs running on different
	CPU architectures.

2) It is very easy to document and maintain.

3) Makes debugging IO problems trivial because you can check your
	output files by eye.

Unless you have an enormous amount of data or hard real-time constraints
the overhead added by the text parsing is usually insignifficant.  It can
even be faster then binary IO when variant records are involved, because may
compilers tens to write out binary variant records in fixed size record
set at the maximun size, and if most of your record are small this wastes
a lot of space and you will often find that the ascii version of the file
is smaller enough that the saving in disk IO time more then makes up for
the text parsing overhead.

             reply	other threads:[~1993-06-03 20:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-03 20:24 Mark A Biggar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-06-03 14:44 Representation clauses Jeff Etrick
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox