Print

Print


Richard Maine wrote:
...
> Heck, with typical disk technology, it is physically impossible
> to read anything other than whole sectors from a disk.  I don't
> recall what typical disk sector sizes run these days (been a while
> since I had to work at that level).

Sector sizes tend to be quite small, even on very large disks.
Space occupied by a file tends to be allocated in units of several
sectors.  But to avoid internal fragmentation (loss of available space
due to unused fragments allocated to files) these allocation units
tend to be only a very small multiple of the sector size.

> You will certainly have to read all of the sectors containing record
> headers.  If records are big enough to span multiple disk sectors,
> then it *MIGHT* be plausible that you could avoid the disk read
> of some of those sectors - but I wouldn't count on it even then.

The OP mentioned records with on the order of a million elements
(each element probably larger than a byte).  I think we can assume
sector sizes *much* smaller than that.  But, can we assume that the
I/O support library is clever enough to notice that it's reading an
"empty" record?  I don't know common practice well enough to
say for sure.  I suspect they are, since it's not that hard a calculation
and it could save lots of time.

--
J. Giles