24 #pragma warning( disable: 4996 )
31 #include <sys/types.h>
46 int main(
int argc,
char **argv) {
54 fprintf(stderr,
"usage: %s <datapath/datafilebasename> <index>\n", argv[0]);
58 tmpbuf = calloc(strlen(argv[1]) + 11,1);
59 sprintf(tmpbuf,
"%s.idx", argv[1]);
60 idxfd = open(tmpbuf, O_RDONLY|
O_BINARY);
61 sprintf(tmpbuf,
"%s.dat", argv[1]);
62 datfd = open(tmpbuf, O_RDONLY|
O_BINARY);
65 offset = atoi(argv[2]) * 6;
67 read(idxfd, &offset, 4);
68 read(idxfd, &size, 2);
69 printf(
"offset: %ld; size: %d\n", offset, size);
71 read(datfd, datbuf, 40);
73 printf(
"%s\n", datbuf);