Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!CU20B.CC.COLUMBIA.EDU!SIT.BUSH
From: SIT.BUSH@CU20B.CC.COLUMBIA.EDU (Nick Bush)
Newsgroups: comp.os.vms
Subject: RE: Re: VMS C reading fortran files
Message-ID: <12404784901.18.SIT.BUSH@CU20B.CC.COLUMBIA.EDU>
Date: 8 Jun 88 11:58:37 GMT
References: 
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 28

>I agree that C under VMS has problems with fortran carriage control
>files.  First, if the first line of the file starts with a blank, C
>will return a newline immediatly. This is not how this sequence is
>supposed to be interpreted. Also, every line in a file will have a
>Carriage return appended to the end of it. I beleive this is contrary
>to the way C handles files and records in general.  I think that
>reading a fortran carriage control file should return EXACTLY the
>same steam of characters as reading a file that was CONVERTed to
>a variable length, carriage return carriage control file.  This is
>not the way C does it.

It sounds like VAX C is converting the carriage control exactly as it should
to match the definition of FORTRAN carriage control.  Note that it is not
necessarily the conversion most people expect.  We ran into this when 
implementing FORTRAN carriage control conversion for VMS Kermit.  The 
definition of FORTRAN carriage control given in the VAX RMS Reference Manual
on page 5-23 indicates that a blank in the carriage control column indicates
that when printed the record should be *preceded* by a line feed and 
followed by a carriage return.  This is not what most people expect, but it
is the only definition of FORTRAN carriage control I know of that allows it
to actually match the characteristics implied by the FORTRAN '77 standard.

- Nick Bush
  Sterling-Winthrop Research Institute
  Rensselaer, NY 12144

SIT.BUSH@CU20B.CC.COLUMBIA.EDU (Internet)
SIT.BUSH@CU20B (BITNET)
-------