|
From: Rene R. <re...@gr...> - 2002-07-20 09:23:44
|
The problem here is that I don't know how many entries a file have in the databases. Not a good thing. I was thinking about assigning ranges to the files instead. example. file number 1 has the range 000-099, number 2 has the range 100-199 That would make it easy to fetch needed values and files don't have to have the same amount of entries. Let me know what you think.. I would like to do it right this time :) -Rene > I finally got the database to behave properly. > > The size of the database is much smaller than I wrote last time. > I've got an 11 MB text file which is converted into an 18 MB database. > > I've arranged the databases this way: > > fileindex.db > keys are in this format: <"incrementing-number" dash "data-type"> > Data-type are things like path, name and size. > > example: > 0000000-00 => pathname > 0000001-01 => filename > 0000002-02 => date > 0000003-03 => size of file > 0000004-00 => pathname > 0000005-01 => filename > 0000006-02 => date > 0000007-03 => size of file > > More data-types can be added. The only limitation at the moment is that > all files must have all data-types. So if I add a new data-type to one > file I need to add that to the rest as well. I can however be empty > values on the files that don't need it, but they key must be there. > > > dirindex.db has entries in this format: > The key is the full path > The value is the index range in fileindex.db > example: > path/to/somewhere => 300-312 > some/other/path/1 => 313-544 > > The databases are generated when the backup is run. > I also managed to generate the dirtree at the same time. > That is saved as a serialized object and loaded when the users wishes to > browse the files. That saves about 6 seconds of loading time on some of > my backups. > > > You said that you have some experience with these simple databases. > Please let me know if you think there a better ways to do this. > Then I can correct it before I continue. > > -Rene > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel |