bug-coreutils
[Top][All Lists]
Advanced

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

Re: Linux Bug to command ( OD ) - Written by Jim Meyering


From: Eric Blake
Subject: Re: Linux Bug to command ( OD ) - Written by Jim Meyering
Date: Fri, 17 Jul 2009 19:10:13 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to trever plantaginate on 7/17/2009 4:22 PM:
> OD is listing the bytes of a file in reverse order due to how it would look 
> in memory and not how the bytes appear in the file.

Not true, nor is this a bug in od.  There is a difference between
little-endian and big-endian machines, and od is one of the tool that
exposes those differences (you will get your desired ordering if you were
to repeat your same test on a different architecture).  You are seeing the
listing exactly as it would appear reading 16 bits at a time given your
machine's endianness.

If you truly want byte listings, rather than uint16_t listings, then use
od -tx1.

>  Pipes to and from this command would alter the original oder of the
file's contents.

Pipes effectively pass 8 bits at a time, not 16 bits at a time.  So, on
your machine (regardless of whether it is little- or big-endian), data
will not be scrambled.  You only get scrambling when you interpret
multiple bytes as a single entity in a different manner than which your
hardware does.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkphIPUACgkQ84KuGfSFAYA9cACfUzckHFadyh7UGKWVFDcAN7wu
fi0AnRQm/NYCkd+JVMiOJyxKX3wgUQTW
=Pi5T
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]