Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 1999 17:48:14 -0400 (EDT)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        freebsd-questions@FreeBSD.ORG (FreeBSD Questions)
Subject:   Reading 'Foreign' Binaries
Message-ID:  <199909152148.RAA28463@cc942873-a.ewndsr1.nj.home.com>

next in thread | raw e-mail | index | archive | help
I have large (100s MB) files that are written in binary formats. That
is, structures from C programs are just dumped to files using
write(2). All of them are produced on SGIs (MIPS processor), which,
like most computers, have the opposite endian convention than i386s.

I have never had to deal with this issue before and have not been able
to get this help from my usual C resources. I found the htonl, htons,
ntohl, and ntohs family of functions, but they only seem to want to
help with int's. The structures I want to read are full of int's,
float's, double's, and char's. Looking over what happens when I
write(2) float's from both platforms has not been particularly
enlightening yet.

I probably could figure this out given the time, but I would have to
guess this has been dealt with many times before. Why re-invent the
wheel? Can anyone point me in the right direction or offer direct
help? 

Thanks. 
-- 
Crist J. Clark                           cjclark@home.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909152148.RAA28463>