From: Rob (spamrefuse_at_yahoo.com)
Date: Wed Jun 17 2009 - 10:59:23 CDT

Axel Kohlmeyer wrote:
>
> in .dcd files the first record is exactly 84 bytes and the first entry
> is a string 'CORD', so the first 4 or 8
bytes should be the integer
> number 84 followed by 'C' 'O' 'R' 'D'.
if you look at a binary file
> in a hex viewer, you can check it out

I compile ABINIT on my Fedora 10 and 11 Linux system with
GCC 4.3.2.

The ABINIT binary data files appear with an undocumented tag at
the start of the file; this tag depends on the endianness and the
record length.
With a record length 4 (or 8), it has a 4 (or 8) bytes tag, as follows:

Little-endian / 4 : 0e 00 00 00
Little-endian / 8 : 0e 00 00 00 00 00 00 00

Big-endian / 4 : 00 00 00 0e
Big-endian / 8 : 00 00 00 00 00 00 00 0e

I can use these tags to set the endianness and record length of
the binary data file, and then read the binary data accordingly.

However, so far I have only generated binary data files on my
Linux system. I have no idea how generic these tags are.
How machine dependent would my code be if I rely on these
tags.....??What would you guess?
I myself don't yet have other architectures to test it on.

Rob.