Converting between 64 and 32 bit data - 07-12-2005 , 02:18 AM
Hi, I use BDB in my app and it works fine on both 32 and 64 bit
architecture. The same code compiles and runs without trouble on both
Is there a way to convert data produced on the 64 bit machine with the
64 bit version into data that can be used by the 32 bit version on the
32 bit platform? Some utility or whatever? Or is there a painless way
to tweak the 64 bit version so that it produces data compatible with a
32 bit platform?
Re: Converting between 64 and 32 bit data - 07-12-2005 , 02:39 AM
Sorry, I guess I wasn't RTFM properly... I should be able to use
db_dump and db_load for this problem, right?
Re: Converting between 64 and 32 bit data - 07-12-2005 , 03:24 AM
"ErikArner" <erik_arner (AT) hotmail (DOT) com> writes:
networking between a 32 bit and a 64 bit machine. Proceed in the same
way: standarize on a format for the external representation, and
write conversion code of that representation into native format.
External representations can be chosen in a variety of ways.
I think the most modern one is XML, if you don't care much
about conversion efficiency. The lazy approach is to use
the 32-bit struct format, and write a single (bothway)
conversion function, used solely on the 64-bit system.
As far as I know, none of this is "automatic", i.e. you have to
write the correct code before you ->put, and after you ->get,
from the database.
Of course, suitable modularization and/or class structure can hide
all conversions under the rug.
Re: Converting between 64 and 32 bit data - 07-12-2005 , 04:36 AM
Actually I don't need to store any 64 bit data, it's just that I want
the DB files to work on both systems regardless of where they were
created. So I tweaked the code to only store 32 bit data and now
everything works like a charm.