Re: [Circle] Suggestion for crossplatform binary format

From: Jack Wilson (deejay@cu-online.com)
Date: 08/14/96


jeremy elson wrote:
>> Why not prefix every Circle binary file with a 32 bit integer (such
>> as 0x01020304).  If, when the file is loaded, the driver detects that
>> the number is not equal to 16909060 (decimal for 0x01020304), it will
>> know that the file was saved in a different format than the driver
>> is currently using, so it can convert.
>
>An even better idea IMHO, which may eventually be implemented, is to
>write each binary number to the playerfile using htonl() and reading it
>with ntohl().
>

Well, the prefix was an idea to make the file platform-independent
without having to rewrite it.  i.e. if such code were in Circle today,
all the implementors would have to do is prepend 0x01020304 to their
existing files.  With network byte ordering, they would have to do
a pfile/rentfile wipe, or write special code to convert the entire
file.  Uck.

>  But this may be pointless if Circle eventually moves to
> ASCII playerfiles anyway.

For sure.  But unless *you* put ASCII playerfiles into the Circle
distribution, there will never be a standard that everyone can work
with.  :)  Get cracking!  Hee hee.

-- 
[----- Jack Wilson ------- mailto:deejay@cu-online.com ----------------]
[--- Home page: http://www.cu-online.com/~deejay/ ---------------------]
[- PGP fingerprint:  99 C9 B7 A3 C4 72 DD 87  72 CF 67 50 63 48 D0 6D -]
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/07/00 PST