| Re: NEW_LINE function only returns one character |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.fortran · Group Profile
Author: Ron ShepardRon Shepard Date: Aug 14, 2008 08:12
In article page.demo.co.uk>,
Clive Page wrote:
> I hadn't appreciated that C also behaved that way. One of the (few)
> attractions of C, it seems to me, is the impression that one is getting
> at the bits in memory (or on disc) without any barriers or possibly
> misleading translation stages in the way.
If you think about it, it really is not practical for a portable
language to return exactly what is in the file. Some operating
systems support several types of file systems, so you would get
different results with the same program when it was using the "same"
file contents stored on these different file systems. Some file
systems support various file formats, and in these cases the program
would produce different results even on the same file system. And
what about parity bits and error correcting bits that are stored in
the file -- these might differ for different file types, different
file systems, different devices on the same computer, or even
different partitions on the same device. Some devices, such as hard
disks, have sector information stored on the disk surface, should
this information be returned during an I/O request?
Practically speaking, some level of abstraction is necessary for a
high-level language to achieve the goal of portability. The
difference between the traditional fortran-style and C style
abstractions is that fortran is record oriented and C is byte
(character) oriented. They are both abstractions, neither approach
gives the untranslated bits stored in the file on the device.
$.02 -Ron Shepard
|