Thread: Re: [Dev-C++] Quick flat-file searching and I/O
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2003-08-01 06:49:16
|
Hey that looks useful from the description - I for one will look at that! >From: "Yeoh HS" <ye...@ye...> >Reply-To: "Yeoh HS" <ye...@ye...> >To: <ci...@ya...>, "Dev-C Mailing List" ><dev...@li...> >Subject: Re: [Dev-C++] Quick flat-file searching and I/O >Date: Fri, 1 Aug 2003 10:15:51 +0800 > >----- Original Message ----- >From: "David McKen" <ci...@ya...> > > Application is used to store world data for a game. We wish > > to use mySQL (or some other SQL database) as well asbe able > > to store data in flat-files. > >For a database, you might want to check out SQLite. > >Here's some info from its website. >"SQLite is a C library that implements an embeddable SQL database engine. >Programs that link with the SQLite library can have SQL database access >without running a separate RDBMS process. SQLite is not a client library >used to connect to a big database server. SQLite is the server. The SQLite >library reads and writes directly to and from the database files on disk." > >The URL is: >http://www.sqlite.org > > >Best Regards, >Yeoh >-- > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger |
|
From: David M. <ci...@ya...> - 2003-08-01 19:02:00
|
That looks quite interesting... Would save me the trouble of re-writing the current file format. ----- Original Message ----- From: "Yeoh HS" <ye...@ye...> To: <ci...@ya...>; "Dev-C Mailing List" <dev...@li...> Sent: Thursday, July 31, 2003 10:15 PM Subject: Re: [Dev-C++] Quick flat-file searching and I/O > ----- Original Message ----- > From: "David McKen" <ci...@ya...> > > Application is used to store world data for a game. We wish > > to use mySQL (or some other SQL database) as well asbe able > > to store data in flat-files. > > For a database, you might want to check out SQLite. > > Here's some info from its website. > "SQLite is a C library that implements an embeddable SQL database engine. > Programs that link with the SQLite library can have SQL database access > without running a separate RDBMS process. SQLite is not a client library > used to connect to a big database server. SQLite is the server. The SQLite > library reads and writes directly to and from the database files on disk." > > The URL is: > http://www.sqlite.org > > > Best Regards, > Yeoh > -- > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
|
From: David M. <ci...@ya...> - 2003-08-03 02:05:41
|
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 ----- Original Message ----- From: "Kevin Wood" <ke...@me...> To: "Dev-C Mailing List" <dev...@li...> Sent: Friday, August 01, 2003 7:58 PM Subject: Re: [Dev-C++] Quick flat-file searching and I/O > Hi everyone, > > I think the quickest way to access a portion of a file is to structure it, > then use the fseek function from stdio. > > In the case we are considering, the data for each room should be about the > same size. For example, if the data for a room is 500 bytes, each room's > data can be stored in a file at 500 byte intervals, then accessed using the > standard library routines. So to access room 50, you would set the file > pointer at 50 x 500. > fseek(room_file_pointer, room_number * 500, SEEK_SET); > > If the data for each object is large, several files may be needed, maybe > with an index file. > > Kev. > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
|
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 |