Subject: RATIOS

From: Brad Waite <[email-masked]>
Date: Thu, 23 Oct 1997 13:00:25 -0600

Okay, folks.  I've figured that the best way to maintain a ratio file is
to use fixed-length byte count fields.  That makes it easy to modify the
file while maintaining field integrity.  

But now there's another issue.  What kind of byte counts should we
store?  There's been a suggestion to store both the total uploaded
Kbytes as well as the total downloaded K, and calculate the user's
download credit dynamically (based on that user's ratio).  The problem
with this method becomes apparent when you change that user's ratio. 
For instance, if a user has a 1:10 ratio, and has uploaded 2 megs, and
downed 20 megs, his stats would be 2000/20000, and he wouldn't be
allowed to down anything more.  Now let's suppose that since he's been a
good gumby that you increase his ratio to 1:20.  Now he can download an
additional 20 megs without upping anything else.

The other method I can see is to store the credits in K that the user
has available.  After a STOR, multiply the number of K the user ups by
his ratio and add it to the existing value in the file.  That way you
always have an accurate credit record.

The first method allows you to track total usage, but I think that'd be
best done in another file or by a log analyer.

Comments?

-Brad Waite