Narendran wrote:
> thanks a lot,
> I am unable to resolve the problem for 3 days,hat's off to everyone.
As far as I know, all technologies which transfer data between machines
(e.g. RPC), languages (e.g. JNI) or wear the cross platform crown (e.g.
SQLite) have some sort of data definition. Without any doubt they'll
take explicit care about byte ordering, word size, alignment etc. File
compression utilities are platform agnostic too.
Since this is an old problem and none of RPC, JNI etc came up with a
better way this implies to me that it's simply not possible to invent a
simple, general yet reliable method in a couple of days. XML is meant to
cover this area so I suspect it's just not do-able in the general case.
I assume you've looked at and decided against the XML route, so..
For fixed, published data structures I'd look at the source for gzip or
bzip and see how they marshal their data. They're cross platform file
formats and are pretty well tested.
For arbitrary data structures (which is what I suspect is what you want)
and having used Python (rather than RPC or JNI) a lot recently I'd grab
the source and have a look at the code which implements the "struct"
module. This module lets you read/write C style data structures (from/to
files, sockets etc) based on a simple ASCII format string. Again, it's
pretty well tested and will be cross platform at the Python end and
platform specific (which is what you want) at the C end.
HTH
Martin
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------