Path: utzoo!mnetor!uunet!husc6!mailrus!ames!amdahl!dlb!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: Pascal --> C question Message-ID: <351@goofy.megatest.UUCP> Date: 24 Mar 88 22:08:20 GMT References: <225800016@uxe.cso.uiuc.edu> Organization: Megatest Corporation, San Jose, Ca Lines: 55 in article <225800016@uxe.cso.uiuc.edu>, mcdonald@uxe.cso.uiuc.edu says: > Nf-ID: #R:goofy.megatest.UUCP:302:uxe.cso.uiuc.edu:225800016:000:1556 > Nf-From: uxe.cso.uiuc.edu!mcdonald Mar 21 07:58:00 1988 > [ Stuff about "flush" meaning different things in Unix and VMS: In VMS "flush" means "end-of-record", and "end-of-record" means '\n'. ] > > The VMS C compiler isn't broken. > Oops! You better tell them quickly, because a previous posting says that it has been fixed in the next release! I still don't know anything about VMS, but I can hardly take your advice about not talking about it until I do. Hell, if everybody had that attitude, hardly anything would get said, ever! It is true that "a little knowledge is a dangerous thing," as is evidenced by the majority of the postings to this group. But I think that ignorance, when freely admitted, is quiet benign. So I offer these comments to be considered in view of may complete lack of competence in VMSisms: There is some little problem with mapping the semantics of stdio byte-streams (as defined by the Unix implementation) to the VMS record oriented files. But making flush() synonymous with end-of-record, and inserting gratuitous newlines ain't part of the answer. IBM -- or was it Whitesmith's -- had exactly the same problem porting the stdio library to VM/CMS, MVS, and MVS/XA. They did a pretty good job of it. See "C Language Manual", IBM publication SC09-1128-0, Chapter 9. They defined an (almost) reversible mapping from the record oriented files onto the (virtual) byte-streams of stdio. It's not perfect. For example, it is sometimes necessary to pad lines with blanks as they go into record oriented files, and then remove trailing blanks as the record oriented files are read as text-streams. So trailing blanks which really were in the stdio stream get discarded. Oh well... The description of fflush() on page 11-83 says, "fflush drains any unwritten data in the output buffer for the stream controlled by the FILE..." Dave Jones Megatest Corp. 880 Fox Lane San Jose, CA. 95131 (408) 437-9700 Ext 3227 UUCP: ucbvax!sun!megatest!djones ARPA: megatest!djones@riacs.EDU "If it's really broken, go ahead and fix it."