Sponsored Content
Operating Systems Solaris Solaris 5.8 - BinaryFile - Endianness Post 302349915 by angshuman_ag on Wednesday 2nd of September 2009 08:31:55 AM
Old 09-02-2009
I used a HEX Editor and converted the binary file to BIG-endian format. And, then I ran the same parser code. It still returns garbage Smilie

So, keeping the original Binary File intact, while reading, how do I judge the native datatype for byte swapping order - because these n/w apis suggest something like this -

ntohs() - “network to host short
Converts the unsigned short integer netshort from network byte order to host byte order.
ntohl() - “network to host long
Converts the unsigned integer netlong from network byte order to host byte order.
 

5 More Discussions You Might Find Interesting

1. Solaris

application compiled on solaris 10 throwing error when executed on solaris 9

I have compiled my application on Solaris 10 with following description SunOS ldg1 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Blade-T6320 The compiler is Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25 But when installing the application on Solaris 9 SunOS odcarch02 5.9... (2 Replies)
Discussion started by: ash_bit2k2
2 Replies

2. Solaris

Unable to login using ssh,telnet onto my solaris machine with solaris 10 installed

Hi, I am unable to login into my terminal hosting Solaris 10 and get the below error message "Server refused to allocate pty ld.so.1: sh: fatal: libc.so.1: open failed: No such file or directory " Is there anyways i can get into my machine and what kind of changes are required to be... (7 Replies)
Discussion started by: sankasu
7 Replies

3. UNIX for Advanced & Expert Users

How to know endianness of a machine

hi I have a ubuntu machine and want to know the endianness of the system.... How would i get to know..... The information of my machine is: uname -a 42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 201 1 i686 i686 i386 GNU/Linux and lsb_release -a No LSB modules are available.... (6 Replies)
Discussion started by: Ankita Singlaa
6 Replies

4. Solaris

How to add Solaris text console to Solaris grub2 menu?

Hi, I am new to sloaris and just instlled the solaris 11.2, i know little more about linux, i open the /boot/grub/grub.cfg in solaris and there is many other entries forl solaris 11.2 one of them is for 'Oracle Solaris 11.2 text console' but at boot grub2 only show the first default entry that... (1 Reply)
Discussion started by: shamsat
1 Replies

5. AIX

IBM TDS/SDS (LDAP) - can I mix endianness among servers in an instance ?

I'd like to add some x/linux-based servers to my current AIX-based TDS/SDS server community. Reading the Fine Install Guide (rtfig ?) I believe this may be covered by the section "Upgrade an instance of a previous version to a different computer" i.e. I'm going to install latest/greatest SDS on a... (4 Replies)
Discussion started by: maraixadm
4 Replies
TSLMENDIAN(1)						User Contributed Perl Documentation					     TSLMENDIAN(1)

NAME
tslmendian - change the byte-order of sunpinyin's threaded back-off language model SYNOPSIS
tslmendian [option] DESCRIPTION
slmendian converts the binary language model files used by SunPinyin from big-endian to small-endian or vice versa. OPTIONS
-e endian Specify the output-lm-file's endian-ness. It can be le or ge. If not given, tslmendian uses the host's endian-ness. -v Prints out the endian-ness of input-lm-file. -i input-lm-file Identify the input file of convert. Generally, this file is generated by slmthread or tslmpack. -o out-lm-file Identify the output file of convert. NOTES
The converted output file is equivalent to the input. But if you compare the output of tslminfo of both files, the ARPA file generated by tslminfo may different. This is due to the different precision in different machines. And due to uninitialized padding data in data structure, the checksum of the original data file may different from the converted-back file, even though they are identical from SunPinyin's point of view. AUTHOR
Originally written by Kov. Chai <tchaikov.gmail.com>. Currently maintained by Kov.Chai <tchaikov@gmail.com>. SEE ALSO
slmthread(1). tslminfo, tslmpack. perl v5.14.2 2012-06-09 TSLMENDIAN(1)
All times are GMT -4. The time now is 08:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy