[ From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 14-AUG-1990 23:09:42.26  To:	MRGATE::"ARISIA::EVERHART" CC:	@ Subj:	Re: PBMPLUS problems with PCX and GIF files (STREAM files)  * Received:  by crdgw1.ge.com (5.57/GE 1.70)) 	 id AA27864; Tue, 14 Aug 90 22:57:16 EDT U Received: From EQL.CALTECH.EDU by CRVAX.SRI.COM with TCP; Tue, 14 AUG 90 18:56:07 PDT % Date:     Tue, 14 Aug 90 18:53:11 PDT ) From: rankin@EQL.Caltech.Edu (Pat Rankin) 3 Message-Id: <900814184908.43c000a9@EQL.Caltech.Edu> D Subject:  Re: PBMPLUS problems with PCX and GIF files (STREAM files) To: info-vax@sri.com  I [ PC->VAX graphics problem due to PCSA, digressing into RMS internals :-]   G >>      ...The default file type for PCSA is STREAM. The VAX C run-time K >>      library does not handle STREAM files correctly (it uses STREAM_LF).  > L > There is no such thing in VMS as a STREAM file.  A stream format is one inK > which records are delimited by certain particular characters or character M > sequences.  VMS supports three variations of stream format:  STREAM_LF (the K > most common, terminator is a LINEFEED); STREAM_CR (terminator is CARRIAGE O > RETURN); and STREAM_CRLF (terminator is a CARRIAGE RETURN/LINEFEED sequence).   G      It's just stream, not stream-crlf, and stream format is a bit more D general than that.  Form-feeds are also terminators.  The RMS manualE lists FF, VT, LF, and CR/LF.  The Guide_to_File_Applications contains G conflicting info:  FF, CR, and CR/LF.  I haven't bothered to figure out H which--if either--is correct.  Neither is complete, since CR/FF is valid and delimits a single record.    [...] N > Note that all three stream formats write the data to the file in exactly the > same format:  G       This is somewhat misleading, since the record terminators differ. D The internal format may be the same, but the file contents won't be.  N >              All the bytes are there, and there are no extra bytes, as thereJ > are in a variable-length record file, for example, which contains record
 > lengths.  F      I'll stress a key point:  the line-feed and/or carriage-return isC _part_ of the data in the stream format files (and there is nothing H extra added).  For record format files, these control characters are notH [ordinarily] stored in the file, but other control information is.  ThatH control information is normally out-of-band; you don't see it if you let RMS process the records.  G >           This is also the same format as a fixed-length record file.   G      This is incorrect (half the time :-).  Fixed-length records always I have word alignment; odd-length records are padded by a NUL byte.  If you G create a file with fixed-length 1-byte records, it will end up twice as  big as you expected ;-).  L >                                                                        TheM > differences among the four are entirely in how they are interpreted by RMS, H > which in turn is determined by the type, as stored in the file header.  D      The file header can be modified, which will change the way thatF the file is intrepreted without actually altering the file contents at3 all.  I consider this a last-resort measure though.   F      In the case at hand, you can read STM (cr/lf) files in as if theyI were STM_LF, but your input data will include an explicit carriage-return I character at the end of each record so the program(s) must be prepared to G deal with it.  As an alternative, the following will copy the file into  stream-lf format: 7  |$ CONVERT/FDL=SYS$INPUT: original.file converted.file   |file$  |        organization    sequential  |record#  |        format          stream_lf   |^ZH This will work for converting either stream (cr/lf) or normal text filesE (variable records w/ implied carriage control) into stream-lf copies.   2                 Pat Rankin, rankin@eql.caltech.edu  