Newsgroups: comp.lang.lisp.mcl
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!trinews.sbc.com!news.mid.net!news.ksu.ksu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!cs.utexas.edu!convex!news.duke.edu!eff!news.umbc.edu!haven.umd.edu!ames!eos!casner
From: casner@eos.arc.nasa.gov (Steve Casner)
Subject: Searching files
Message-ID: <1995Feb10.163020.15720@eos.arc.nasa.gov>
Organization: NASA Ames Res. Ctr, Calif.
Date: Fri, 10 Feb 1995 16:30:20 GMT
Lines: 15

I'm trying to write some search routines that efficiently search through
files of data that include entries of variable length.  The function
(file-position stream) always returns the character position within a
file.  This isn't much help if all of my file entries are of different
length (as in a file containing encyclopedia-like entries).  I'd like
to implement a binary search but will need to advance file position
in discrete file entry increments.  What's the solution to this?  Do
I need a table of the known character positions for the start of each
entry?  This would seem like a hassle to maintain.  What I'd really
like to have the file contain object definitions that get treated as
a single unit.

Any help is appreciated.

casner@eos.arc.nasa.gov
