[log in to unmask] wrote:
> So I'd say that in every sense except the record length, a stream file puts
> MORE shackles on the programmer, not fewer.
I have to disagree with you on this. I keep encountering cases in which one wants to read in a Fortran program a file written by a program in some other language. Just a couple of examples: a .DBF file (a format used by numerious PC databases), or a FITS file (widely used by astronomers). In each case the file consists of a header area followed by records which are usually of fixed length. There's really no portable way to do that in Fortran, except perhaps using formatted direct-access with a record length of one character, which is exceptionally inefficient and more of a fudge to get stream I/O than anything.
Such files can be read (or even written) easily using Fortran stream I/O, and of course equally easily in languages such as C, C++, C#, Java etc which also support stream I/O.
You may say that in none of these languages is there any truly portable way of doing this. That may be strictly true (suppose your file uses ASCII and your computer EBCDIC) but in practice people just want to get the job done, and are willing to put up with less than precisely 100% portability.
--
Clive Page
|