?
Solved

reading index file

Posted on 2013-06-04
3
Medium Priority
?
304 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
[X]
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
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 35

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 1500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

764 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