comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew <I.Dont@Think.So.Com>
Subject: Binary File Manip. - Possibly a stupid question
Date: 1999/07/21
Date: 1999-07-21T00:00:00+00:00	[thread overview]
Message-ID: <3795BF16.BCF418D6@Think.So.Com> (raw)

Greetings,

<NOTE - if this is a double posting I'm sorry - I'm having some problems
with my system clock.>

Sorry if this is a stupid question, but I'm writing a simple huffman
compression program (just to see if it works) and I want it to work on
all types of files (binary as well as text).

After much head-scratching (I'm working with some basic 2nd year Uni
knowledge, the On-Line Ada95 reference manual and a first-level text
book with no mention of binary files) I came to the conclusion that I
have to use some kind of Stream (since Stream_IO's End_Of_File
references the file's size instead of a special character), but I have
no idea how to use them properly.

What I want to do is read in a file in 32K chunks, compress each chunk
(the code for which I've already written), and then write the compressed
chunks and header info back to disk.

My compression alg. is currently running on the assumption that the
stuff read in from the source file can be accessed in 8-bit-byte chunks
that can be mapped to character representations.

So is there anywhere I can look to get some detailed info on
reading/writing binary files?

If you prefer you can email me at ua.ten.qu@okolom (backwards obviously
:)

TIA,
MB

-- 
How am I supposed to hallucinate with all of these coloured lights
distracting me?




             reply	other threads:[~1999-07-21  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-21  0:00 Matthew [this message]
1999-07-20  0:00 ` Binary File Manip. - Possibly a stupid question Ted Dennison
1999-07-21  0:00   ` Gautier
replies disabled

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