Subject: | Reading 32-bit Storable files on 64-bit system |
Date: | Fri, 21 Dec 2007 11:09:42 +0000 |
To: | <bug-storable [...] rt.cpan.org> |
From: | Mark Young <mark_young [...] hotmail.com> |
Hi,
I have a perl application that has been running for many years on a 32-bit Debian system using perl v5.8.4 and Storable v2.14. That application has stored thousands of files in Storable format using the store() command. I'm attempting to migrate to a new 64-bit system using perl v5.8.8 and Storable v2.18. I've found that retrieve() on the 64-bit system can not read the 32-bit systems' Storables. The error it produces is
Byte order is not compatible at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/_retrieve.al) line 380, at ./try line 37
The problem appears to be that retrieve() on the 64-bit system is not happy with the Storables longsize, ptrsize and byteorder. If I write out a Storable on each system and use the Storable::file_magic to read the details of the header I get these values that differ between the two systems.
32 bit system: 'hdrsize' => 15, 'version' => '2.7', 'longsize' => 4, 'ptrsize' => 4, 'byteorder' => '1234',
64 bit system: 'hdrsize' => 19, 'version' => '2.7', 'longsize' => 8, 'ptrsize' => 8, 'byteorder' => '12345678',
I have subsequently found out, thanks to the perlmonks, that if I write a storable using nstore() then the resultant file can be written by either then 32-bit or 64-bit system and can be read by either the 32-bit or 64-bit system. That's useful, but unfortunately I have many thousands of files that would need to be converted. So the reason I am writing to explain this is to ask whether you would consider that the 64-bit system should be able to read the store() file written out by the 32-bit system? Shouldn't the 64-bit system be able to read the header of the Storable file and thus know how to read the contents?
My ideal situation would be to be able to enable the 64-bit system to read the 32-bit systems' storables, preferably in a manner that means it could read Storables written out by either a 32-bit system or a 64-bit system, in the same way you get that capability if you'd used nstore all along.
Please let me know what you think?
Best Regards,Mark Young
BTW - The incompatibility is the same between a 32-bit perl v5.8.8 Storable v2.18 system and a 64-bit perl v5.8.8 Storable v2.18 system.