Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

reading index file

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
valid enum? 6 75
Why is compiler in oracle server ? 9 75
Precision Problem in C++ 7 44
Autosar OS Multicore Share Resources confusion ? 2 71
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

861 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