Re: End of record marker - 32 vs. 64 bit



Steve Lionel <steve.lionel@xxxxxxxxx> wrote:

I'm not sure why you feel you are locked to g77.

And if you do feel that you are locked into g77, then you are also
locked into this problem. To my knowledge, g77 is no longer under active
maintenance, at least in terms of feature requests, which is what that
would count as.

Let me also note that this is not the only problem you will run into in
terms of binary compatibility of sequential unformatted files. The
standard basically guarantees nothing at all about their portability.
They are guaranteed to work only with the particular compiler that made
them. There was a time when they were quite non-portable for many, many
more reasons than just this. As it happens there has been enough
convergence that you can often get decent portability of them, but they
still are not a good choice for a portable file.

In addition to the 32-bit vs 64-bit record markers, you also have
byte-sex issues as a significant difference in today's systems. That
applies even from one Unix system to another.

I have generally regarded sequential unformatted files as a handy and
efficient convenience for files not intended to be portable. For
example, they are fine for temporary files. I used to use formatted
sequential files for portability; they still remain by far the most
portable form. But at times, the penalties for formatted files are
unreasonably high. It does take a bit of work to do a good job of a
portable binary format. F2003 stream I/O helps a lot.

--
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: End of record marker - 32 vs. 64 bit
    ... And if you do feel that you are locked into g77, ... [SNIP] ... sequential files for portability; they still remain by far the most ... portable binary format. ...
    (comp.lang.fortran)
  • Re: A Question about arrays file merging
    ... > I do have some programing experience-mostly working ... and in both cases load the output into an array? ... format you can use either language's I/O facilities [e.g. 'fopen', ... then I understand the portability concern. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: 9bit arithmetics in C
    ... If his computer is big endian then he will not have to change anything. ... Lets also assume the simulation requores that these ... the native format and the one which converts from the native format to ... emulation of the simulated hardware and of the about portability of the ...
    (comp.lang.c)
  • Re: Self Decrypting Archive Freeware?
    ... I agree that PKZIP 2.0 encryption is not portable not even secure. ... the other hand portability is always a relative issue not even the C ... already a second AES - zip format and counting. ... the 2.0 version will be supported atleast the required 10 years. ...
    (sci.crypt)
  • Re: C++ streams and serialization
    ... convert your numbers to text format. ... > compiler libraries or OS libraries change. ... Portability is one of the reason I'm using text streams. ... On a side note, I _know_ I read the faq cover to cover, but I'm positive ...
    (comp.lang.cpp)