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:
Glenn Cole <[log in to unmask]>
Reply To:
Date:
Fri, 30 Apr 1999 13:51:46 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
David Rutherford asks:

> "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?"

By definition, no, you can't determine an exact meaningful value for the
maximum number of records.

At first blush, it looked like MPE would help with this.  :HELP FINFO
reports on my 5.5pp6 system:

        28  BYTE FILE SIZE     Integer       Total number of bytes
            BYTEFILESIZE                     allowed in file

        49  BYTE FILE SIZE     Integer       Current file size
            BYTEFILESIZE                     (in bytes)

(The identical mnemonics appear to be an error;
'ByteFileSize' is equivalent only to 49.)

Unfortunately, for VA files, both returned the same value, which appears
to be the total allowed bytes.

The only thing I can think of here, for VA files, is the awkward

        !#                 -c counts characters
        !xeq wc.hpbin.sys '-c' < filename > temp
        !input  numchars < temp
        !
        !# convert value from a string to a number
        !setvar numchars ![ltrim(numchars)]
        !
        !# no known mnemonic for            28 (total bytes allowed)
        !setvar maxchars finfo( 'filename', 28 )
        !
        !setvar pctfull  100 * numchars / maxchars
        !if     pctfull > 80
        !   echo file 'filename' getting full
        !endif


Michael Hensley adds:

> VA files are similar to the kinds of files on more primitive operating
> systems like DOS and UNIX (which don't have structured files);
> to determine how full a DOS or UNIX file is, you have to read the file
> from the beginning and count the bytes.

I assume Michael means you have to read the file from beginning to end
in order to count the number of records.  The byte count is available
directly.

--Glenn

.......................................................................

Item Subject: cc:Mail Text

ATOM RSS1 RSS2