Re: Assistance Reading Binary Data



Ken Plotkin <kplotkin@xxxxxxxxxxxxxx> wrote:

On Wed, 27 Feb 2008 16:43:26 -0800 (PST), e p chandler <epc8@xxxxxxxx>
wrote:

[snip]
Fortran 2003 allows "stream i/o" with an unformatted file. This
transmits the data without any accompanying record structure.
[snip]

A lot of F77 and F90/95 compilers also allow this, with various
keywords like "binary" or "transparent" or "system." F2003
standardized this, both in the finer details of how it works and in
the name.

"unformatted" is still around, but still isn't a pure stream of bytes.

Actually unformatted is orthogonal to stream, at least in the f2003
standardized version. You can have formatted streams and unformatted
streams. An unformatted stream is a pure stream of bytes. In saying that
"unformatted isn't a pure stream of bytes", you are probably thinking
about unformatted sequential.

Some of the vendor-specific versions are different... (and special-cased
in that you might specify form='binary', but then that sort of overrides
access also... or something like that).

But in the standard, there are 3 access methods (sequential, direct, and
stream), and two forms (formatted and unformatted). All 6 combinations
are allowed.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: CR-NL, NL and ftell
    ... a program capable of both card and tape output ... > the keyboard was not part of standard C! ... from any input source: ... if you use a text stream to read the data back again: ...
    (comp.lang.c)
  • Re: Handling errors in standard output statements with openmcl (learner questions)
    ... stream variable you can use to get your error output, ... its value is #<Stream for Standard Input>. ... PATHNAME: NIL. ... its value is #<Stream for Standard Error>. ...
    (comp.lang.lisp)
  • Re: fread breaks file descriptors opened in "w" mode.
    ... stream, in which case it is not rewindable. ... except for that very fseek call. ... the fread returns 0 meaning that there was nothing to read: ... That's allowed by the standard. ...
    (comp.lang.c)
  • Re: Will reading from stdin() flush output to stdout()?
    ... > Regarding if a fflushof the standard output is needed or not. ... characters are intended to be ... > transmitted as a block to the host environment when a buffer is filled, ... > when input is requested on an unbuffered stream, ...
    (comp.lang.c)
  • Re: Stream text/data to zip/gpg instead of passing app a filename?
    ... stream the text/data into gpg.exe to end up with the encrypted file ... accepts input from stdin, then you simply need to write to its stdin   ... Do those commands work when you type them into the command line? ... /// Reader thread for standard output ...
    (microsoft.public.dotnet.languages.csharp)