Newsgroups: comp.lang.fortran
Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!alchemy.chem.utoronto.ca!system
From: system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson))
Subject: Re: Bug with file I/O?
Message-ID: <1991Jan28.175145.26536@alchemy.chem.utoronto.ca>
Organization: University of Toronto Chemistry Department
References: <quan.664695995@sol> <1991Jan24.145718.28686@alchemy.chem.utoronto.ca> <2136@travis.csd.harris.com>
Distribution: comp
Date: Mon, 28 Jan 1991 17:51:45 GMT

In article <2136@travis.csd.harris.com> bill@hcx2.ssd.csd.harris.com (Bill Leonard) writes:
>In article <1991Jan24.145718.28686@alchemy.chem.utoronto.ca>, system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson)) writes:
>> 	 As an aside, why not use binary/unformatted direct I/O;
>> it is orders of magnitude faster than formatted I/O on all systems I
>> have ever used?
>
>Beware!  Unformatted I/O is not guaranteed to work if you mix data types.
>Writing an INTEGER and reading a CHARACTER may give unpredictable results.

I would not have just converted the program given to not use a FORMAT,
I would also make it read/write only integers to the direct access file.
While using A format on integers "works" on most systems, I wouldn't
recommend it either, and mixing data types between the write and the
read in unformatted I/O is almost a sure trip to disaster as Bill points out.
-- 
Mike Peterson, System Administrator, U/Toronto Department of Chemistry
E-mail: system@alchemy.chem.utoronto.ca
Tel: (416) 978-7094                  Fax: (416) 978-8775
