From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 13-AUG-1990 14:33:18.05 To: MRGATE::"ARISIA::EVERHART" CC: Subj: Re: PBMPLUS problems with PCX and GIF files Received: by crdgw1.ge.com (5.57/GE 1.70) id AA16207; Mon, 13 Aug 90 14:13:05 EDT Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Mon, 13 AUG 90 10:55:58 PDT Received: by ucbvax.Berkeley.EDU (5.63/1.42) id AA24467; Mon, 13 Aug 90 10:38:30 -0700 Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 13 Aug 90 17:41:11 GMT From: psuvm!psuecl!praxa!ttt@psuvax1.cs.psu.edu (Trevor Taylor) Organization: Praxa Ltd. Subject: Re: PBMPLUS problems with PCX and GIF files Message-Id: <65378@praxa.com.au> References: <"900809173026.76366.323.EHL28-4"@CompuServe.COM> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com In article <"900809173026.76366.323.EHL28-4"@CompuServe.COM>, 76366.323@CompuServe.COM (Level Five Research) writes: >>I have been trying to get PBMPLUS working with files copied up from a PC, >>however have met with little success. >> >>Creating a two colour (i.e. B/W) picture with Microsoft Paintbrush, copying >>the resulting file up to the VAX using PCSA, and typing :- > > How is the file service that you're using under PCSA set up? Is it creating > FIXED length files, or STREAM files? For some programs, it does make a > difference. > Specifically, the problem is as follows: The default file type for PCSA is STREAM. The VAX C run-time library does not handle STREAM files correctly (it uses STREAM_LF). There are three ways around the problem: 1. Set your file service up to use FIXED files (512 bytes). VAX-C reads these OK. 2. Get a copy of the FILE utility from DECUS and use it to change the file attributes from STREAM to STREAM_LF. (NOTE: There is absolutely nothing wrong with the data in the file -- it is just the file attributes which cause VAX-C to access it incorrectly.) 3. Change the code so that you force it to open the files with a context of STREAM as follows: fopen(fp,file,"r","ctx=stm"); This is a VAX extension and is non-portable. Furthermore, if you use this approach, then the normal interpretation of other file types, including sequential, indexed, etc., does not happen. In fact, it reads EVERY byte in the file!!! The reason for this problem has to do with the way that VAX-C converts record-oriented files into a stream of bytes for reading. This is necessary for normal files, such as those created with EDT, to be read correctly. Unfortunately, it does not understand STREAM, only STREAM_LF. Maybe somebody at DEC would care to explain this apparent inconsistency? Trevor