Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was just jolted into reality when I found that my linux application running on an intel chip became little endian. I am communicating with a Unix (big endian) platform. None of my communication/message constructs are now valid.
Are there any plug and run endian conversion tools (or code if I have to implement it) available that anyone knows of.
Consider yourself lucky you don't have EBCDIC <==> ASCII issues as well ...
If you are doing your own (raw) data transfers, I think you are going to have to handle it yourself. It's a bitch if you have a lot of embedded null values - guess how I know ...
Actually there are plenty of "swap bytes" C codes in the internet, that you can use as template. Take in mind that byte swapping works for pure binaries (I mean files containing only numbers). If there are character values, they must not be swapped.
Consider yourself lucky you don't have EBCDIC <==> ASCII issues as well ...
If you are doing your own (raw) data transfers, I think you are going to have to handle it yourself. It's a bitch if you have a lot of embedded null values - guess how I know ...
Byte-swapping functions do exist, however, and you'll have to use them. Note, however, that many libraries do byte-swapping for you or provide a global way to control that... possibly at compile-time when the library is built. Endian-issues are not that uncommon, after all.
EBCDIC? "Bah! These kids today... why, back in my day we had to do our homework in Baudot!"
{I've still got my "card saw," syg00... do you? And I'm definitely a member of the "I dropped an entire box" club.}
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
Quote:
Originally Posted by sundialsvcs
{I've still got my "card saw," syg00... do you? And I'm definitely a member of the "I dropped an entire box" club.}
Hey, how many other digital media besides cards are still readable after that many years? Floppies, zips, even CDs turn up unusable. Remember how the guy in Cryptonomicon broke the code? He pulled out the box of cards from his dad's belongings after he died.
Last edited by choogendyk; 02-07-2008 at 08:49 PM.
No, some of my old "junk" gets tossed out every time we move house .... :shrug:.
Where I have had issues was using C to drive a raw TCP transfer of RMF (performance) data - it's composed of variable numbers of self-defining (big endian EBCDIC) fields than are *full* of binary zero values. Gave up in disgust.
There is now a z/OS CIM Server (based on OpenPegasus), so I probably should revisit it one day.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.