From mjc@brackley.nag.co.uk  Wed Jun  7 17:52:13 2000
Received: from brackley.nag.co.uk ([62.232.54.10])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id RAA17582
	for <sc22wg5@dkuug.dk>; Wed, 7 Jun 2000 17:51:59 +0200 (CEST)
	(envelope-from mjc@brackley.nag.co.uk)
Received: (from malcolm@localhost)
	by brackley.nag.co.uk (8.9.2/8.9.2) id QAA03834
	for sc22wg5@dkuug.dk; Wed, 7 Jun 2000 16:52:22 +0100 (BST)
	(envelope-from mjc)
From: Malcolm Cohen (local) <mjc@nag.co.uk>
Message-Id: <200006071552.QAA03834@brackley.nag.co.uk>
Subject: Re: SC22WG5.1842) N1385 AFNOR proposal for August WG5 meeting
To: sc22wg5@dkuug.dk
Date: Wed, 7 Jun 2000 16:52:22 +0100 (BST)
X-Mailer: ELM [version 2.4ME+ PL43 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Van Snyder wrote:
>> This is different from the semantics of BACKSPACE in Fortran.

Robert Corbett wrote:
>If a byte stream is considered a file composed of one-byte records,
>it would have the same semantics as a BACKSPACE statement.

Malcolm writes:
If a byte stream is considered to be a file composed of one-byte records,
it is useless for anything other than reading one-byte objects (by the
usual Fortran semantics).

BACKSPACE hasn't a chance: consider a file set up with

   OPEN(88,FORM='XDR_UNFORMATTED')
   WRITE(88) X1
   WRITE(88) X2
   WRITE(88) X3
   CLOSE(88)

for
   REAL X1(127)
   DOUBLE PRECISION X2(1000,1000)
   COMPLEX X3(3)

This is defined to write 3 records to the file.

Then

   OPEN(88,FORM='XDR_UNFORMATTED')
   READ(88) X1
   READ(88) X2
   READ(88) X3
   BACKSPACE(88)
   BACKSPACE(88)
   READ(88) NEWX2
   READ(88) NEWX3

has to result in NEWX2==X2 and NEWX3==X3.  i.e. the BACKSPACE is required to
be over the records written (if it can be done).

Never mind BACKSPACE, 'XDR_UNFORMATTED' cannot even handle READ!

Consider, with the same file:

   OPEN(88,FORM='XDR_UNFORMATTED')
   READ(88) NEWX1
   READ(88)              ! Skips over X2
   READ(88) NEWX3

has to result in NEWX1==X1 and NEWX3==X3.

i.e. if we want to make XDR_UNFORMATTED look like UNFORMATTED we have to write
record markers.  If, as Robert Corbett implies, it has none, then we need to
define a whole new kind of i/o file.

Ugh.

Cheers,
-- 
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
                           (malcolm@nag.co.uk)
