Solved

reading index file

Posted on 2013-06-04
3
277 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 32

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now