32 vs. 64 bit binary files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So we've run into our first real snag on the conversion road from 32 to 64
bit.  We write out a binary file full of data and then read it back in using
fwrite and fread.

My file format is pure binary and it's as follows:

Long height
Long width
For (short; height * width)
Long
Long

So in the 32 bit world, this works great.  But when trying to read these 32
bit files into software on the 64 bit systems, I'm running into problems!

There are no delimeters in my file that I can use to determine which arch
the file was written on.

What I need is some kind of method to determine the arch, possibly based on
the file???  I don't know???  All I need to know is, from the code level, if
it's a 32-bit binary file or a 64-bit binary file?

Thanks,

-b


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux