[Info-vax] Portable OpenVMS binary data format?

Louis Krupp lkrupp at nospam.pssw.com.invalid
Tue Aug 7 05:59:45 EDT 2018


On Tue, 7 Aug 2018 02:20:57 -0700 (PDT), Steven Schweda
<sms.antinode at gmail.com> wrote:

>> As far as I can tell, STREAM_LF appends a linefeed (0x0a)
>> to each record, STREAM_CR appends a carriage return (0x0d),
>> STREAM_CRLF appends a carriage return and a linefeed, and
>> STREAM appends nothing at all. [,,,]
>
>   Yeah, except that there is no "STREAM_CRLF.  HELP FORTRAN
>Statements OPEN RECORDTYPE says:
>
>         'STREAM'     Data is not grouped into records and
>                      contains no control information.
>
>But an actual experiment reveals otherwise:
>
> 00 00 00 03 0A 0D 00 00 00 02 0A 0D 00 00 00 01 ................ 000000
> 00 06 0A 0D 00 00 00 05 0A 0D 00 00 00 04 0A 0D ................ 000010
> 0A 0D 00 00 00 01 0A 0D FF FF FF FF 0A 0D 00 00 ................ 000020
> 00 00 00 04 0A 0D 00 00 00 03 0A 0D 00 00 00 02 ................ 000030
> 00 00 0A 0D 00 00 00 06 0A 0D 00 00 00 05 0A 0D ................ 000040
>
>
>The actual CR+LF record delimiter agrees with what FAB$C_STM
>does, as opposed to, say, FAB$C_STMLF or FAB$C_STMCR.  Trust
>no one, I always say.
>
>> [...] since you're writing binary data, I don't believe
>> there's any point in appending anything at all.
>
>   All I can see is potential trouble from any line-ending
>character(s) if the data are not lines of text.
>
>> [...] if you use STREAM_LF or STREAM_CR or STREAM_CRLF,
>> you're just going to confuse the next person who looks at
>> your program.
>
>   Forget the next _person_; worry about the next _program_. 
>And there is no "STREAM_CRLF"l that's "STREAM".
>
>
>> Keep it simple. Just use STREAM, [...]
>
>   Half right.
>
>   There was a reason for my suggestion of "recordtype =
>'fixed'".

I stand corrected.

Louis



More information about the Info-vax mailing list