Speed of seeks

Larry Campbell campbell at maynard.UUCP
Sat May 17 10:06:01 AEST 1986


> Incidentally, despite the poor design of the files a seek() does not have to
> read every sector... a mistake often made by library writers is to try to
> make seek offsets simple integers. According to the library, the argument
> to an absolute seek() (lseek(fd, off, 0) or lseek(fd, off, 2)) only needs
> to be the returned value from a tell() call: it may indeed be a magic cookie
> like a sector/offset pair (and in fact "magic cookie" is the way it's described
> in the manual). It is under RSX/11M and on the ATARI 800.
> -- Peter da Silva
> -- UUCP: ...!shell!{baylor,graffiti}!peter; MCI: PDASILVA; CIS: 70216,1076

Wrongo.  First, the manual describes the offset as a long (NOT a "simple
integer" nor a "magic cookie").  Second, if the offsets AREN'T integers,
then almost any database library or package won't work (like dbm(3)),
because they often hash keys into offsets in the index file.
-- 
Larry Campbell                                 The Boston Software Works, Inc.
ARPA: maynard.UUCP:campbell at harvard.ARPA       120 Fulton Street
UUCP: {harvard,cbosgd}!wjh12!maynard!campbell  Boston MA 02109



More information about the Comp.unix.wizards mailing list