HP3000-L Archives

January 2000, Week 3

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:
Glenn Cole <[log in to unmask]>
Date:
Tue, 18 Jan 2000 16:02:56 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
Here's a little "gotcha" with finfo's "byte file size" (or "bytefilesize")
parm:

/:listf [log in to unmask],2
ACCOUNT=  SAA         GROUP=  GCOLE

FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX

BDIEXT1   644     644B  FA        1000      50000  11     4096  5 32
BDIEXT2   SD      644B  FA        1000      50000   6     4224  6 32


/:calc finfo( "bdiext1.gcole","bytefilesize" )
650144, $9EBA0, %2365640
/:calc finfo( "bdiext2.gcole","bytefilesize" )
648864, $9E6A0, %2363240
/

Both files have the same number of fixed-length records, each with
the same reclen, yet the total bytes is different!

That's right: the file's *user labels* are included in this count.

/:calc finfo("bdiext1.gcole","user labels avail")
24, $18, %30
/:calc finfo("bdiext2.gcole","user labels avail")
19, $13, %23
/
/:calc (650144 - 648864) / (24 - 19)
256, $100, %400
/

Each user label is 256 bytes, so that accounts for the difference.

Of course, "byte file size" is technically correct, but it's
misleading if you're really looking for the number of bytes
that would be read from the file.  (Sure, in this case we could
just do the multiplication, but we may not always have fixed-length
records.)

--Glenn

ATOM RSS1 RSS2