Next | Lightweight Databases | 34 |
If we need to modify variable-length records, we can do that
Recall that the problems are:
The new version of the record might not be big enough to fill all the space
Or there might not be enough room for the new version in the old space
(1) is easy to deal with: Just leave behind some padding characters
(2) can't be dealt with; the record must move
Replace it with padding and put the new record at the end
You also have to fix your search function to ignore the padding
Example code is in modify-in-place.pl; example data in MIP
Next | Copyright © 2003 M. J. Dominus |