HP3000-L Archives

April 1999, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Woods <[log in to unmask]>
Reply To:
Jeff Woods <[log in to unmask]>
Date:
Fri, 30 Apr 1999 15:59:45 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
At 4/30/99 03:07 PM , Michael D. Hensley wrote:
>> "Is there a calculation I can use to determine the maximum number of
>> records a VA type file can contain, therefore enabling me to only report
>> this file when it is approaching that limit?"
>
>Depends on the length of each record.  If the flimit is 1000, and the
>(maximum) record size is -100 (100 bytes), then the maximum size of the file
>is 1000*100, or 100,000 bytes.  This is room for a thousand 100-byte records,
>ten-thousand 10-byte records, one-hundred-thousand 1-byte records, or an
>indeterminate number of records of assorted sizes.

Well, OK...  if you ignore the overhead the record length stored with each
record.  :)

Unlike fixed length record files, the flimit on a variable record file is the
maximum number of blocks the file can contain.  The record size shown for the
file is really the block size.

How many records fit into any given block depends on the size of the records.
Each record has a couple of bytes of overhead to store the record length.  (It
used to be 2 bytes per record and I think it still is but it may have changed
to 4 bytes per record.)

Each block also has the same size overhead in each block because the file
system knows there's not another record in the block when the record length for
the next record is -1, IIRC.  Records that don't fit in the space at the end of
a block are placed in the next block and the rest of the space in the block is
wasted.

I believe that the file system keeps track of the block number where the EOF
is, but I can't think of a fast and easy way to get that information without
PrivMode.  If you had it, then you would know how many blocks are in use and
could calculate the fullness of the file in terms of blocks used instead of
records used.
--
Jeff Woods
[log in to unmask]  [PGP key available here via finger]

ATOM RSS1 RSS2