[r6rs-discuss] Mixed binary and ascii data in a single file
On Aug 8, 2007, at 4:03 PM, Alan Watson wrote:
> Astronomical FITS files also have an ASCII header followed by
> binary data. One option is to treat the file as binary and grab the
> header character by character. Another is to open the file twice,
> once as an ASCII text stream and once as a binary stream, read the
> header from the text stream, calculate the length of the header in
> bytes, offset the binary stream to the start of the binary data,
> and finally read the data from the binary stream.
Thanks for your reply. Now that you remind me, I remember that I've
worked with FITS files, too, in the now-distant past.
The r6rs solutions seem fairly clumsy compared to what is available
in Gambit (and perhaps in other implementations), where you can
change the buffering of a port after it has been opened. (Or at
least, you can safely change it from unbuffered to buffered after it
has been opened.)
Brad
Received on Wed Aug 08 2007 - 16:20:24 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC