Re: [Dev-C++] Quick flat-file searching and I/O
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-08-04 02:42:59
|
Hmm, That would work. The only slow down would be when a description changes. If it is the same size we are fine if it is different then the indexes for all the records that follow would have to be updated. There will be more reads than writes anyway. Sincerly David Mcken ----- Original Message ----- From: "Joel Bushart" <bus...@be...> To: <ci...@ya...> Sent: Sunday, August 03, 2003 9:46 PM Subject: Re: [Dev-C++] Quick flat-file searching and I/O > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > David McKen wrote: > > | Small problem. > | > | Room descriptions are strings of variable length. Also the > | exit descriptions > | are included in the same structure(also varible length > | strings). This can > | cause the size of a room to vary greatly). > | > | This might still work if I were to put a limit on how long > | a room > | description could be and padd shorter descriptions to make > | it equal the > | standard size > | > > Perhaps, you could have two files one holding the data and one holding a > ~ index of the data in an array or bintree. Say you wanted to load room 50 > you look it up in the index file (or array if you pre-load it into > memory) and then read that location using fseek. > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.2 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQE/LbsC5Wf7lt1ATJ4RAr0pAJwKLhW1CfdtDMUu5Snli15zNDKL7wCeOPpv > NJonQxtZfspRYrdLfUSCGUQ= > =Xc1/ > -----END PGP SIGNATURE----- > __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |