+ assert (path);
+
+ if (zh->path_reg && !yaz_is_abspath(path))
+ {
+ strcpy (src, zh->path_reg);
+ strcat (src, "/");
+ }
+ else
+ *src = '\0';
+ strcat (src, path);
+ stat (src, &sbuf);
+
+ strcpy (src, path);
+ src_len = strlen (src);
+
+ if (S_ISREG(sbuf.st_mode))
+ {
+ struct dirs_entry *e_dst;
+ di = dirs_fopen (dict, src);
+
+ e_dst = dirs_read (di);
+ if (e_dst)
+ {
+ if (sbuf.st_mtime > e_dst->mtime)
+ if (fileExtract (zh, &e_dst->sysno, src, rGroup, 0))
+ dirs_add (di, src, e_dst->sysno, sbuf.st_mtime);
+ }
+ else
+ {
+ SYSNO sysno = 0;
+ if (fileExtract (zh, &sysno, src, rGroup, 0))
+ dirs_add (di, src, sysno, sbuf.st_mtime);
+ }
+ dirs_free (&di);
+ }
+ else if (S_ISDIR(sbuf.st_mode))
+ {
+ if (src_len && src[src_len-1] != '/')
+ {
+ src[src_len] = '/';
+ src[++src_len] = '\0';
+ }
+ di = dirs_open (dict, src, rGroup->flagRw);
+ *dst = '\0';
+ fileUpdateR (zh, di, dirs_read (di), src, dst, rGroup, 0);
+ dirs_free (&di);
+ }
+ else
+ {
+ logf (LOG_WARN, "Ignoring path %s", src);
+ }