Re: Saving mail and notes

From: d. hall (dhall@OOI.NET)
Date: 06/15/98


>>>>> thus on Mon, 15 Jun 1998 17:36:17 +0200, Mark wrote:

> char action_description[MAX_MAIL_LENGTH+1];

> Will it use 4096 HD space for -every- item, or will it just use the space
> that's filled?

It will use 4096 bytes for every item, plus whatever else you put in that
structure.  In all you'll only eat up 4 megs with 1000 messages.  How many
messages do plan to keep existant at any one time?  I take the long view
that hard drive space is cheap, but I know that isn't always the case when
you're not the sysadmin for your own machine.

> Anyone know more elegant ways of saving the text on "virtual paper"?

Elegant?  No.  A little more saving in space, maybe...

You can keep a separate ascii file with message body, i.e. like the help
file, delimited by some sort of string, kinda like a "###\n", and you can
reference this information via exact byte location of the start of the
record and the size of the record.

The downside is... when you extract a record, it gets messy to "shiftdown"
all the records ahead of it to fill the resulting gap.

Or you can always emulate the innd/qmail by just creating numbered files
(it does eat inodes like popcorn), and having an index file that references
the pertinent information for each numbered file.

So file 1-400 would have the body of the messages, and the "header"
information could be kept in a single file, one header per line.

> Any help would be greatly appreciated

Attempting to create variably sized files isn't easy.

d.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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