Binary I/O on stdin/stdout?
Larry Jones
scjones at sdrc.UUCP
Sun Apr 3 10:35:33 AEST 1988
In article <3295 at haddock.ISC.COM>, karl at haddock.ISC.COM (Karl Heuer) writes:
> In article <2500 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
> >[In VMS] the default type of a file opened from a C program is stream-LF,
> >which uses records terminated by linefeeds, and does not distinguish between
> >text and binary formats at all, acting like UNIX and POSIX files.
>
> The fact that it's called "stream-LF" (as distinct from "stream-CR" or just
> "stream") suggests that the newlines which terminate the records have some
> significance to the OS. Is it legal, for example, to write 70000 characters
> without a newline? If not, this doesn't seem like an acceptable format for
> binary mode.
Yes, you can write as many characters as you want without a newline - you
don't even need one at the end of the file. The only significance of the
"stream-LF" designation is to allow the file system to simulate a record
structured file meaningfully. Since most VMS programs are only capable of
handling record structure files (stream file being relatively new), this
is of immeasurable value.
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC MAIL: 2000 Eastman Dr., Milford, OH 45150
AT&T: (513) 576-2070
"When all else fails, read the directions."
More information about the Comp.lang.c
mailing list