From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,374196e3581ef3b8 X-Google-Attributes: gid103376,public From: Matthew Subject: Binary File Manip. - Possibly a stupid question Date: 1999/07/21 Message-ID: <3795BF16.BCF418D6@Think.So.Com>#1/1 X-Deja-AN: 503112598 Content-Transfer-Encoding: 7bit Organization: University of Queensland X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-07-21T00:00:00+00:00 List-Id: Greetings, 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?