Solved

reading index file

Posted on 2013-06-04
3
282 Views
Last Modified: 2013-06-18
In my application, I see b-trees are populated in memory and is stored persistenty on file on the system also. How can I read this file, as I need to replace all the values of keys due to change in data structure of value
0
Comment
Question by:perlperl
3 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 39219146
That depends on your application.
Does your application have a function to read the file?
Can you determine the file format your application uses to store  b-trees?
0
 
LVL 33

Expert Comment

by:sarabande
ID: 39219488
if you have the store function you easily could deduce the read function from it (if not already exists as mentioned by ozo). in some cases the stored data was encrypted and needs decryption when read from file.

normally a stored b-tree would be read at initialization phase into memory. it is much likely that it has fixed-record length and binary data.

changing the keys will arise problems in a b-tree as the keys are sorted and (normally) are stored in packed format. so any change in length or value would make the tree invalid as long as you don't use the built-in remove and insert functions.

Sara
0
 
LVL 15

Accepted Solution

by:
Minh Võ Công earned 500 total points
ID: 39253330
This is a sample implementation B-tree in file

http://forum.codecall.net/topic/41058-b-tree-c-implementation/
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question