Storable byteorder incompatibilities in different FreeBSD installations

Fernan Aguero fernan.aguero at gmail.com
Sat Jan 3 14:22:03 UTC 2009


On Sat, Jan 3, 2009 at 11:57 AM, Anton Berezin <tobez at tobez.org> wrote:
> Fernan,
>
> On Sat, Jan 03, 2009 at 10:33:22AM -0200, Fernan Aguero wrote:
>
>> Apart from the byteorder issue, the other issue which I raised in my
>> post, was also the incompatibility in 'longsize' between two perl
>> instances built from ports, in different boxes.
>>
>> In this case, the perl built in a FBSD-6.3, i386 box has a longsize of
>> 4, whereas the same perl built in FBSD-7.1, amd64 has a longsize of 8.
>> In both cases they were compiled with PERL_64BITINT (the default for
>> the port), and in both cases the byteorder is the same!
>>
>> How can I build a perl with a byteorder of 12345678, and a longsize of
>> 4, in an amd64 platform? Is that possible at all?
>
> Not really.  Amd64 is a 64-bit platform, meaning sizeof(long) = 8.  I am
> pretty positive that the same is true for x86-64 Linux.  That's more or less
> what "12345678" indicates.
>
> At any rate, this is the application design issue.  The practical solution
> in your case would be to take an offline copy of the DB, and to go through
> every record and convert it into a KNOWN to you binary format.  I have not
> done the relevant testing, so I do not even know whether nstore() will do
> what you want - after all, it only handles the byteorder issues, not integer
> size issues.

I am doing these tests as we speak, and will convert all my data using
nstore/nfreeze.

Thanks.

> Cheers,
> \Anton.


-- 
fernan


More information about the freebsd-perl mailing list