Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
If I am not mistaken, the single-entry IDX file simply contains offsets into the data file. Simplistically, this means there's a look up table of some sort that says that the record having this particular value in the index is actually found at physical record number n. Or perhaps it contains an actual byte offset into the data file. This is, after all, what an index file is designed to accomplish: to "index" or order the data elements in a fashion other than their physical order.
Now, this is what the IDX file does, and a CDX file is merely a collection of IDX files, so therefore you have to determine which of the tags within the CDX is the one you want, and then locate the particular entry within that tag that points to the particular record in question.
It sounds a lot more complex than it is, but this is the functionality that is engaged when you perform the command
SET ORDER TO [SOMETAGNAME], or (even better example but VFP7 only)
INDEXSEEK("SOMEDATA","ALIASNAME","TAGNAME")
You merely want to open this mechanism to find what physical record it is pointing at. To do this, you probably have to close the indices, and perform a low-level open of the CDX file using perhaps the FOPEN() function. Then you will have to locate the appropriate piece of data using FREAD().
There used to be information detailing the internal structure of the IDX/CDX files somewhere. Does anyone know if it's still around?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement