HP3000-L Archives

February 2004, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Clogg <[log in to unmask]>
Reply To:
John Clogg <[log in to unmask]>
Date:
Wed, 18 Feb 2004 08:52:55 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (15 lines)
Joe Andress asks:
>Given that a record has binary data, regardless of the field definition,
>what will happen when (due to bad luck) 2 bytes of binary data just happens
>to equate to a record termination byte sequence of line feed, carriage
>return?

I haven't seen anyone offer an answer to this, so here is my understanding of the answer, based on rather sketchy knowledge of the subject.  Others will undoubtedly correct me if I misstate anything:

Although the file system on Unix does not manage records as such, your program can still do so.  In other words, if your program defines a record length of 100 bytes, each READ you do will retrieve the next 100 bytes of data from the file.  The file system may not regard that as a record, but you really don't need it to; you are responsible for managing your own data.  Demarcating the end of a record with a carriage return is only necessary when accepting free-form input, which will be ASCII data and should not contain "accidental" return characters, or when outputting data to a printer or terminal, which is also ASCII.

The shortened version of the above is that binary files do not use a carriage return character (or CR-LF) as a record separator.  I'm not sure how variable-length records are handled.  

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2