2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.49 1996-02-05 12:29:57 adam
8 * Logging reduced a bit.
9 * The remaining running time is estimated during register merge.
11 * Revision 1.48 1996/02/01 20:53:26 adam
12 * The temporary per-record keys are compacted a little, and duplication
13 * of the per-records keys are avoided when they are saved in the record
16 * Revision 1.47 1996/01/17 14:57:48 adam
17 * Prototype changed for reader functions in extract/retrieve. File
18 * is identified by 'void *' instead of 'int.
20 * Revision 1.46 1995/12/15 14:57:16 adam
23 * Revision 1.45 1995/12/15 12:37:41 adam
24 * In addRecordKeyAny: Writes key only when attrSet != -1.
26 * Revision 1.44 1995/12/12 16:00:54 adam
27 * System call sync(2) used after update/commit.
28 * Locking (based on fcntl) uses F_EXLCK and F_SHLCK instead of F_WRLCK
31 * Revision 1.43 1995/12/11 09:12:46 adam
32 * The rec_get function returns NULL if record doesn't exist - will
33 * happen in the server if the result set records have been deleted since
34 * the creation of the set (i.e. the search).
35 * The server saves a result temporarily if it is 'volatile', i.e. the
36 * set is register dependent.
38 * Revision 1.42 1995/12/07 17:38:46 adam
39 * Work locking mechanisms for concurrent updates/commit.
41 * Revision 1.41 1995/12/06 16:06:42 adam
42 * Better diagnostics. Work on 'real' dictionary deletion.
44 * Revision 1.40 1995/12/05 16:57:40 adam
45 * More work on regular patterns.
47 * Revision 1.39 1995/12/05 13:20:18 adam
48 * Bug fix: file_read sometimes returned early EOF.
50 * Revision 1.38 1995/12/04 17:59:21 adam
51 * More work on regular expression conversion.
53 * Revision 1.37 1995/12/04 14:22:27 adam
54 * Extra arg to recType_byName.
55 * Started work on new regular expression parsed input to
58 * Revision 1.36 1995/11/30 08:34:29 adam
59 * Started work on commit facility.
60 * Changed a few malloc/free to xmalloc/xfree.
62 * Revision 1.35 1995/11/28 14:26:21 adam
63 * Bug fix: recordId with constant wasn't right.
64 * Bug fix: recordId dictionary entry wasn't deleted when needed.
66 * Revision 1.34 1995/11/28 09:09:38 adam
67 * Zebra config renamed.
68 * Use setting 'recordId' to identify record now.
69 * Bug fix in recindex.c: rec_release_blocks was invokeded even
70 * though the blocks were already released.
71 * File traversal properly deletes records when needed.
73 * Revision 1.33 1995/11/27 09:56:20 adam
74 * Record info elements better enumerated. Internal store of records.
76 * Revision 1.32 1995/11/25 10:24:05 adam
77 * More record fields - they are enumerated now.
78 * New options: flagStoreData flagStoreKey.
80 * Revision 1.31 1995/11/24 11:31:35 adam
81 * Commands add & del read filenames from stdin if source directory is
83 * Match criteria supports 'constant' strings.
85 * Revision 1.30 1995/11/22 17:19:16 adam
86 * Record management uses the bfile system.
88 * Revision 1.29 1995/11/21 15:01:14 adam
89 * New general match criteria implemented.
90 * New feature: document groups.
92 * Revision 1.28 1995/11/21 09:20:30 adam
93 * Yet more work on record match.
95 * Revision 1.27 1995/11/20 16:59:45 adam
96 * New update method: the 'old' keys are saved for each records.
98 * Revision 1.26 1995/11/20 11:56:24 adam
99 * Work on new traversal.
101 * Revision 1.25 1995/11/16 15:34:54 adam
102 * Uses new record management system in both indexer and server.
104 * Revision 1.24 1995/11/15 19:13:08 adam
105 * Work on record management.
107 * Revision 1.23 1995/10/27 14:00:10 adam
108 * Implemented detection of database availability.
110 * Revision 1.22 1995/10/17 18:02:07 adam
111 * New feature: databases. Implemented as prefix to words in dictionary.
113 * Revision 1.21 1995/10/10 12:24:38 adam
114 * Temporary sort files are compressed.
116 * Revision 1.20 1995/10/06 13:52:05 adam
117 * Bug fixes. Handler may abort further scanning.
119 * Revision 1.19 1995/10/04 12:55:16 adam
120 * Bug fix in ranked search. Use=Any keys inserted.
122 * Revision 1.18 1995/10/04 09:37:08 quinn
125 * Revision 1.17 1995/10/03 14:28:57 adam
126 * Buffered read in extract works.
128 * Revision 1.16 1995/10/03 14:28:45 adam
129 * Work on more effecient read handler in extract.
131 * Revision 1.15 1995/10/02 15:42:53 adam
132 * Extract uses file descriptors instead of FILE pointers.
134 * Revision 1.14 1995/10/02 15:29:13 adam
135 * More logging in file_extract.
137 * Revision 1.13 1995/09/29 14:01:39 adam
140 * Revision 1.12 1995/09/28 14:22:56 adam
141 * Sort uses smaller temporary files.
143 * Revision 1.11 1995/09/28 12:10:31 adam
144 * Bug fixes. Field prefix used in queries.
146 * Revision 1.10 1995/09/28 09:19:41 adam
147 * xfree/xmalloc used everywhere.
148 * Extract/retrieve method seems to work for text records.
150 * Revision 1.9 1995/09/27 12:22:28 adam
151 * More work on extract in record control.
152 * Field name is not in isam keys but in prefix in dictionary words.
154 * Revision 1.8 1995/09/14 07:48:22 adam
155 * Record control management.
157 * Revision 1.7 1995/09/11 13:09:32 adam
158 * More work on relevance feedback.
160 * Revision 1.6 1995/09/08 14:52:27 adam
161 * Minor changes. Dictionary is lower case now.
163 * Revision 1.5 1995/09/06 16:11:16 adam
164 * Option: only one word key per file.
166 * Revision 1.4 1995/09/05 15:28:39 adam
167 * More work on search engine.
169 * Revision 1.3 1995/09/04 12:33:41 adam
170 * Various cleanup. YAZ util used instead.
172 * Revision 1.2 1995/09/04 09:10:34 adam
173 * More work on index add/del/update.
174 * Merge sort implemented.
175 * Initial work on z39 server.
177 * Revision 1.1 1995/09/01 14:06:35 adam
178 * Split of work into more files.
187 #include <alexutil.h>
191 #include "recindex.h"
193 static Dict matchDict;
195 static Records records = NULL;
197 static char **key_buf;
198 static size_t ptr_top;
200 static size_t key_buf_used;
201 static int key_file_no;
203 static int records_inserted = 0;
204 static int records_updated = 0;
205 static int records_deleted = 0;
207 void key_open (int mem)
211 key_buf = xmalloc (mem);
212 ptr_top = mem/sizeof(char*);
218 if (!(matchDict = dict_open (GMATCH_DICT, 50, 1)))
220 logf (LOG_FATAL, "dict_open fail of %s", GMATCH_DICT);
224 records = rec_open (1);
233 void encode_key_init (struct encode_info *i)
239 char *encode_key_int (int d, char *bp)
248 else if (d <= 4194303)
250 *bp++ = 128 + (d>>16);
251 *bp++ = (d>>8) & 255;
256 *bp++ = 192 + (d>>24);
257 *bp++ = (d>>16) & 255;
258 *bp++ = (d>>8) & 255;
264 void encode_key_write (char *k, struct encode_info *i, FILE *outf)
269 while ((*bp++ = *k++))
271 memcpy (&key, k+1, sizeof(struct it_key));
272 bp = encode_key_int ( (key.sysno - i->sysno) * 2 + *k, bp);
273 if (i->sysno != key.sysno)
275 i->sysno = key.sysno;
278 bp = encode_key_int (key.seqno - i->seqno, bp);
279 i->seqno = key.seqno;
280 if (fwrite (i->buf, bp - i->buf, 1, outf) != 1)
282 logf (LOG_FATAL|LOG_ERRNO, "fwrite");
287 void key_flush (void)
292 struct encode_info encode_info;
298 logf (LOG_LOG, "sorting section %d", key_file_no);
299 qsort (key_buf + ptr_top-ptr_i, ptr_i, sizeof(char*), key_qsort_compare);
300 sprintf (out_fname, TEMP_FNAME, key_file_no);
302 if (!(outf = fopen (out_fname, "w")))
304 logf (LOG_FATAL|LOG_ERRNO, "fopen (4) %s", out_fname);
307 logf (LOG_LOG, "writing section %d", key_file_no);
308 prevcp = cp = key_buf[ptr_top-ptr_i];
310 encode_key_init (&encode_info);
311 encode_key_write (cp, &encode_info, outf);
314 cp = key_buf[ptr_top-ptr_i];
315 if (strcmp (cp, prevcp))
317 encode_key_init (&encode_info);
318 encode_key_write (cp, &encode_info, outf);
322 encode_key_write (cp + strlen(cp), &encode_info, outf);
326 logf (LOG_FATAL|LOG_ERRNO, "fclose %s", out_fname);
329 logf (LOG_LOG, "finished section %d", key_file_no);
338 rec_close (&records);
339 dict_close (matchDict);
341 logf (LOG_LOG, "Records inserted %6d", records_inserted);
342 logf (LOG_LOG, "Records updated %6d", records_updated);
343 logf (LOG_LOG, "Records deleted %6d", records_deleted);
347 static void wordInit (RecWord *p)
351 p->which = Word_String;
362 static void addRecordKey (const RecWord *p)
370 if (reckeys.buf_used+1024 > reckeys.buf_max)
374 b = xmalloc (reckeys.buf_max += 128000);
375 if (reckeys.buf_used > 0)
376 memcpy (b, reckeys.buf, reckeys.buf_used);
380 dst = reckeys.buf + reckeys.buf_used;
382 attrSet = p->attrSet;
383 if (reckeys.buf_used > 0 && reckeys.prevAttrSet == attrSet)
386 reckeys.prevAttrSet = attrSet;
387 attrUse = p->attrUse;
388 if (reckeys.buf_used > 0 && reckeys.prevAttrUse == attrUse)
391 reckeys.prevAttrUse = attrUse;
400 memcpy (dst, &attrSet, sizeof(attrSet));
401 dst += sizeof(attrSet);
405 memcpy (dst, &attrUse, sizeof(attrUse));
406 dst += sizeof(attrUse);
408 for (i = 0; p->u.string[i]; i++)
409 *dst++ = p->u.string[i];
412 memcpy (dst, &p->seqno, sizeof(p->seqno));
413 dst += sizeof(p->seqno);
419 reckeys.buf_used = dst - reckeys.buf;
422 static void flushRecordKeys (SYSNO sysno, int cmd, struct recKeys *reckeys,
423 const char *databaseName)
428 while (off < reckeys->buf_used)
430 const char *src = reckeys->buf + off;
438 memcpy (&attrSet, src, sizeof(attrSet));
439 src += sizeof(attrSet);
443 memcpy (&attrUse, src, sizeof(attrUse));
444 src += sizeof(attrUse);
446 if (key_buf_used + 1024 > (ptr_top-ptr_i)*sizeof(char*))
449 key_buf[ptr_top-ptr_i] = (char*)key_buf + key_buf_used;
450 key_buf_used += index_word_prefix ((char*)key_buf + key_buf_used,
451 attrSet, attrUse, databaseName);
453 ((char*)key_buf) [key_buf_used++] = index_char_cvt (*src++);
455 ((char*)key_buf) [key_buf_used++] = '\0';
457 ((char*) key_buf)[key_buf_used++] = cmd;
459 memcpy (&key.seqno, src, sizeof(key.seqno));
460 src += sizeof(key.seqno);
462 memcpy ((char*)key_buf + key_buf_used, &key, sizeof(key));
463 key_buf_used += sizeof(key);
464 off = src - reckeys->buf;
466 assert (off == reckeys->buf_used);
469 static const char **searchRecordKey (struct recKeys *reckeys,
470 int attrSetS, int attrUseS)
472 static const char *ws[32];
477 for (i = 0; i<32; i++)
480 while (off < reckeys->buf_used)
482 const char *src = reckeys->buf + off;
488 memcpy (&attrSet, src, sizeof(attrSet));
489 src += sizeof(attrSet);
491 memcpy (&attrUse, src, sizeof(attrUse));
492 src += sizeof(attrUse);
498 memcpy (&seqno, src, sizeof(seqno));
499 src += sizeof(seqno);
502 logf (LOG_LOG, "(%d,%d) %d %s", attrSet, attrUse, seqno, wstart);
504 if (attrUseS == attrUse && attrSetS == attrSet)
511 woff = seqno - startSeq;
512 if (woff >= 0 && woff < 31)
516 off = src - reckeys->buf;
518 assert (off == reckeys->buf_used);
522 static void addRecordKeyAny (const RecWord *p)
524 if (p->attrSet != 1 || p->attrUse != 1016)
528 memcpy (&w, p, sizeof(w));
533 if (p->attrSet != -1)
537 #define FILE_READ_BUFSIZE 4096
538 struct file_read_info {
541 #if FILE_READ_BUFSIZE
548 static struct file_read_info *file_read_start (int fd)
550 struct file_read_info *fi = xmalloc (sizeof(*fi));
554 #if FILE_READ_BUFSIZE
556 fi->file_buf = xmalloc (FILE_READ_BUFSIZE);
557 fi->file_bufsize = read (fd, fi->file_buf, FILE_READ_BUFSIZE);
562 static void file_read_stop (struct file_read_info *fi)
565 #if FILE_READ_BUFSIZE
566 xfree (fi->file_buf);
572 static int file_read (void *handle, char *buf, size_t count)
574 struct file_read_info *p = handle;
576 #if FILE_READ_BUFSIZE
577 int l = p->file_bufsize - p->file_offset;
583 memcpy (buf, p->file_buf + p->file_offset, l);
585 if (count > FILE_READ_BUFSIZE)
587 if ((r = read (fd, buf + l, count)) == -1)
589 logf (LOG_FATAL|LOG_ERRNO, "read");
594 p->file_noread += l+r;
597 p->file_bufsize = r = read (fd, p->file_buf, FILE_READ_BUFSIZE);
600 logf (LOG_FATAL|LOG_ERRNO, "read");
606 memcpy (buf + l, p->file_buf, r);
607 p->file_noread += l+r;
612 p->file_offset = count;
613 memcpy (buf + l, p->file_buf, count - l);
614 p->file_noread += count;
618 memcpy (buf, p->file_buf + p->file_offset, count);
619 p->file_offset += count;
620 p->file_noread += count;
624 r = read (fd, buf, count);
631 static int atois (const char **s)
634 while ( (c=**s) >= '0' && c <= '9')
636 val = val*10 + c - '0';
642 static char *fileMatchStr (struct recKeys *reckeys, struct recordGroup *rGroup,
646 static char dstBuf[2048];
648 const char *s = spec;
649 static const char **w;
654 while (*s == ' ' || *s == '\t')
661 int attrSet, attrUse;
665 attrSet = atois (&s);
668 logf (LOG_WARN, "Missing , in match criteria %s in group %s",
669 spec, rGroup->groupName ? rGroup->groupName : "none");
673 attrUse = atois (&s);
674 w = searchRecordKey (reckeys, attrSet, attrUse);
679 for (i = 0; i<32; i++)
684 logf (LOG_WARN, "Missing ) in match criteria %s in group %s",
685 spec, rGroup->groupName ? rGroup->groupName : "none");
690 for (i = 0; i<32; i++)
691 if (matchFlag[i] && w[i])
703 logf (LOG_WARN, "Record didn't contain match"
704 " fields in (%d,%d)", attrSet, attrUse);
712 const char *spec_src = NULL;
713 const char *s1 = ++s;
714 while (*s1 && *s1 != ' ' && *s1 != '\t')
720 memcpy (special, s, spec_len);
721 special[spec_len] = '\0';
724 if (!strcmp (special, "group"))
725 spec_src = rGroup->groupName;
726 else if (!strcmp (special, "database"))
727 spec_src = rGroup->databaseName;
728 else if (!strcmp (special, "filename"))
730 else if (!strcmp (special, "type"))
731 spec_src = rGroup->recordType;
736 strcpy (dst, spec_src);
737 dst += strlen (spec_src);
740 else if (*s == '\"' || *s == '\'')
742 int stopMarker = *s++;
746 while (*s && *s != stopMarker)
749 tmpString[i++] = *s++;
754 strcpy (dst, tmpString);
755 dst += strlen (tmpString);
759 logf (LOG_WARN, "Syntax error in match criteria %s in group %s",
760 spec, rGroup->groupName ? rGroup->groupName : "none");
767 logf (LOG_WARN, "No match criteria for record %s in group %s",
768 fname, rGroup->groupName ? rGroup->groupName : "none");
774 struct recordLogInfo {
777 struct recordGroup *rGroup;
780 static void recordLogPreamble (int level, const char *msg, void *info)
782 struct recordLogInfo *p = info;
783 FILE *outf = log_file ();
788 fprintf (outf, "%s of ", p->op);
789 fprintf (outf, "%s type %s\n", p->rGroup->recordType, p->fname);
790 log_event_start (NULL, NULL);
793 static int recordExtract (SYSNO *sysno, const char *fname,
794 struct recordGroup *rGroup, int deleteFlag,
795 struct file_read_info *fi, RecType recType,
798 struct recExtractCtrl extractCtrl;
803 struct recordLogInfo logInfo;
805 logInfo.fname = fname;
807 logInfo.rGroup = rGroup;
808 log_event_start (recordLogPreamble, &logInfo);
814 extractCtrl.subType = subType;
815 extractCtrl.init = wordInit;
816 extractCtrl.add = addRecordKeyAny;
818 reckeys.buf_used = 0;
819 reckeys.prevAttrUse = -1;
820 reckeys.prevAttrSet = -1;
821 extractCtrl.readf = file_read;
822 r = (*recType->extract)(&extractCtrl);
826 logf (LOG_WARN, "Couldn't extract file %s, code %d", fname, r);
831 /* perform match if sysno not known and if match criteria is specified */
838 if (rGroup->recordId && *rGroup->recordId)
842 matchStr = fileMatchStr (&reckeys, rGroup, fname,
846 rinfo = dict_lookup (matchDict, matchStr);
848 memcpy (sysno, rinfo+1, sizeof(*sysno));
852 logf (LOG_WARN, "Bad match criteria");
863 logf (LOG_LOG, "Cannot delete new record");
868 logf (LOG_LOG, "update %s %s", rGroup->recordType,
871 rec = rec_new (records);
876 dict_insert (matchDict, matchStr, sizeof(*sysno), sysno);
878 flushRecordKeys (*sysno, 1, &reckeys, rGroup->databaseName);
884 struct recKeys delkeys;
886 rec = rec_get (records, *sysno);
888 delkeys.buf_used = rec->size[recInfo_delKeys];
889 delkeys.buf = rec->info[recInfo_delKeys];
890 flushRecordKeys (*sysno, 0, &delkeys, rec->info[recInfo_databaseName]);
893 logInfo.op = "delete";
894 if (!delkeys.buf_used)
896 logf (LOG_WARN, "cannot delete; storeKeys false");
901 logf (LOG_LOG, "delete %s %s", rGroup->recordType, fname);
905 dict_delete (matchDict, matchStr);
906 rec_del (records, &rec);
912 logInfo.op = "update";
913 if (!delkeys.buf_used)
915 logf (LOG_WARN, "cannot update; storeKeys false");
920 logf (LOG_LOG, "update %s %s", rGroup->recordType,
923 flushRecordKeys (*sysno, 1, &reckeys, rGroup->databaseName);
928 xfree (rec->info[recInfo_fileType]);
929 rec->info[recInfo_fileType] =
930 rec_strdup (rGroup->recordType, &rec->size[recInfo_fileType]);
932 xfree (rec->info[recInfo_filename]);
933 rec->info[recInfo_filename] =
934 rec_strdup (fname, &rec->size[recInfo_filename]);
936 xfree (rec->info[recInfo_delKeys]);
937 if (reckeys.buf_used > 0 && rGroup->flagStoreKeys == 1)
940 rec->size[recInfo_delKeys] = reckeys.buf_used;
941 rec->info[recInfo_delKeys] = reckeys.buf;
945 rec->info[recInfo_delKeys] = xmalloc (reckeys.buf_used);
946 rec->size[recInfo_delKeys] = reckeys.buf_used;
947 memcpy (rec->info[recInfo_delKeys], reckeys.buf,
948 rec->size[recInfo_delKeys]);
953 rec->info[recInfo_delKeys] = NULL;
954 rec->size[recInfo_delKeys] = 0;
957 xfree (rec->info[recInfo_storeData]);
958 if (rGroup->flagStoreData == 1)
960 rec->size[recInfo_storeData] = fi->file_noread;
961 rec->info[recInfo_storeData] = xmalloc (fi->file_noread);
962 #if FILE_READ_BUFSIZE
963 if (fi->file_noread < FILE_READ_BUFSIZE)
964 memcpy (rec->info[recInfo_storeData], fi->file_buf,
969 if (lseek (fi->fd, 0L, SEEK_SET) < 0)
971 logf (LOG_ERRNO|LOG_FATAL, "seek to 0 in %s", fname);
974 if (read (fi->fd, rec->info[recInfo_storeData], fi->file_noread)
977 logf (LOG_ERRNO|LOG_FATAL, "read %d bytes of %s",
978 fi->file_noread, fname);
985 rec->info[recInfo_storeData] = NULL;
986 rec->size[recInfo_storeData] = 0;
988 xfree (rec->info[recInfo_databaseName]);
989 rec->info[recInfo_databaseName] =
990 rec_strdup (rGroup->databaseName, &rec->size[recInfo_databaseName]);
992 rec_put (records, &rec);
993 log_event_start (NULL, NULL);
997 int fileExtract (SYSNO *sysno, const char *fname,
998 const struct recordGroup *rGroupP, int deleteFlag)
1006 struct recordGroup rGroupM;
1007 struct recordGroup *rGroup = &rGroupM;
1008 struct file_read_info *fi;
1010 memcpy (rGroup, rGroupP, sizeof(*rGroupP));
1012 if (!rGroup->groupName || !*rGroup->groupName)
1015 sprintf (gprefix, "%s.", rGroup->groupName);
1017 logf (LOG_DEBUG, "fileExtract %s", fname);
1019 /* determine file extension */
1020 for (i = strlen(fname); --i >= 0; )
1021 if (fname[i] == '/')
1026 else if (fname[i] == '.')
1028 strcpy (ext, fname+i+1);
1031 /* determine file type - depending on extension */
1032 if (!rGroup->recordType)
1034 sprintf (ext_res, "%srecordType.%s", gprefix, ext);
1035 if (!(rGroup->recordType = res_get (common_resource, ext_res)))
1037 sprintf (ext_res, "%srecordType", gprefix);
1038 if (!(rGroup->recordType = res_get (common_resource, ext_res)))
1041 logf (LOG_LOG, "? %s", fname);
1047 if (!rGroup->recordType)
1050 logf (LOG_LOG, "? record %s", fname);
1054 if (!(recType = recType_byName (rGroup->recordType, subType)))
1056 logf (LOG_WARN, "No such record type: %s", rGroup->recordType);
1060 /* determine match criteria */
1061 if (!rGroup->recordId)
1063 sprintf (ext_res, "%srecordId.%s", gprefix, ext);
1064 rGroup->recordId = res_get (common_resource, ext_res);
1067 /* determine database name */
1068 if (!rGroup->databaseName)
1070 sprintf (ext_res, "%sdatabase.%s", gprefix, ext);
1071 if (!(rGroup->databaseName = res_get (common_resource, ext_res)))
1073 sprintf (ext_res, "%sdatabase", gprefix);
1074 rGroup->databaseName = res_get (common_resource, ext_res);
1077 if (!rGroup->databaseName)
1078 rGroup->databaseName = "Default";
1080 if (rGroup->flagStoreData == -1)
1083 sprintf (ext_res, "%sstoreData.%s", gprefix, ext);
1084 if (!(sval = res_get (common_resource, ext_res)))
1086 sprintf (ext_res, "%sstoreData", gprefix);
1087 sval = res_get (common_resource, ext_res);
1090 rGroup->flagStoreData = atoi (sval);
1092 if (rGroup->flagStoreData == -1)
1093 rGroup->flagStoreData = 0;
1095 if (rGroup->flagStoreKeys == -1)
1099 sprintf (ext_res, "%sstoreKeys.%s", gprefix, ext);
1100 if (!(sval = res_get (common_resource, ext_res)))
1102 sprintf (ext_res, "%sstoreKeys", gprefix);
1103 sval = res_get (common_resource, ext_res);
1106 rGroup->flagStoreKeys = atoi (sval);
1108 if (rGroup->flagStoreKeys == -1)
1109 rGroup->flagStoreKeys = 0;
1111 if (sysno && deleteFlag)
1115 if ((fd = open (fname, O_RDONLY)) == -1)
1117 logf (LOG_WARN|LOG_ERRNO, "open %s", fname);
1121 fi = file_read_start (fd);
1122 recordExtract (sysno, fname, rGroup, deleteFlag, fi, recType, subType);
1123 file_read_stop (fi);