tar or cpio? When is byte swapping necessary?

Chris Torek chris at trantor.umd.edu
Thu Feb 18 01:54:51 AEST 1988


>In article <2071 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>>... portability ought to be achieved by making the cpio *format*
>>portable, not just by compensating for nonportability in the format....

[I agree]

In article <699 at mcdsun.UUCP> fnf at mcdsun.UUCP (Fred Fish) writes:
>Unfortunately this will not work for one not-so-obvious reason, and that
>is because there are systems that when reading the exact same media,
>will return bytes ordered differently.

Such systems are broken.

Yes, there are pieces of hardware that do virtual byteswaps, for
whatever reason.  If your tape or disk controller returns bytes in
the wrong order, your kernel should fix this.  (If you worry about
efficiency, provide a bit in the minor device number to control
this.)

You could equally say `unfortunately, this will not always work,
because there are systems that when reading the exact same media,
sometimes discard all the odd numbered bytes'.  The situation is
the same, except that in the latter case the breakage is much harder
to deny.
-- 
In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163
(hiding out on trantor.umd.edu until mimsy is reassembled in its new home)
Domain: chris at mimsy.umd.edu		Path: not easily reachable



More information about the Comp.unix.questions mailing list