+void repositoryShow (ZebraHandle zh, const char *path)
+{
+ char src[1024];
+ int src_len;
+ struct dirs_entry *dst;
+ Dict dict;
+ struct dirs_info *di;
+
+ if (!(dict = dict_open_res (zh->reg->bfs, FMATCH_DICT, 50, 0, 0, zh->res)))
+ {
+ yaz_log (YLOG_FATAL, "dict_open fail of %s", FMATCH_DICT);
+ return;
+ }
+
+ strncpy(src, path, sizeof(src)-1);
+ src[sizeof(src)-1]='\0';
+ src_len = strlen (src);
+
+ if (src_len && src[src_len-1] != '/')
+ {
+ src[src_len] = '/';
+ src[++src_len] = '\0';
+ }
+
+ di = dirs_open (dict, src, zh->m_flag_rw);
+
+ while ( (dst = dirs_read (di)) )
+ yaz_log (YLOG_LOG, "%s", dst->path);
+ dirs_free (&di);
+ dict_close (dict);
+}
+
+static void fileUpdate (ZebraHandle zh, Dict dict, const char *path)
+{
+ struct dirs_info *di;
+ struct stat sbuf;
+ char src[1024];
+ char dst[1024];
+ int src_len, ret;
+
+ assert (path);
+
+ if (zh->path_reg && !yaz_is_abspath(path))
+ {
+ strcpy (src, zh->path_reg);
+ strcat (src, "/");
+ }
+ else
+ *src = '\0';
+ strcat (src, path);
+ ret = zebra_file_stat (src, &sbuf, zh->m_follow_links);
+
+ strcpy (src, path);
+ src_len = strlen (src);
+
+ if (ret == -1)
+ {
+ yaz_log (YLOG_WARN|YLOG_ERRNO, "Cannot access path %s", src);
+ }
+ else if (S_ISREG(sbuf.st_mode))
+ {
+ struct dirs_entry *e_dst;
+ di = dirs_fopen (dict, src, zh->m_flag_rw);
+
+ e_dst = dirs_read (di);
+ if (e_dst)
+ {
+ if (sbuf.st_mtime > e_dst->mtime)
+ if (fileExtract (zh, &e_dst->sysno, src, 0))
+ dirs_add (di, src, e_dst->sysno, sbuf.st_mtime);
+ }
+ else
+ {
+ SYSNO sysno = 0;
+ if (fileExtract (zh, &sysno, src, 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, zh->m_flag_rw);
+ *dst = '\0';
+ fileUpdateR (zh, di, dirs_read (di), src, dst, 0);
+ dirs_free (&di);
+ }
+ else
+ {
+ yaz_log (YLOG_WARN, "Skipping path %s", src);
+ }
+}
+
+static void repositoryExtract (ZebraHandle zh,
+ int deleteFlag, const char *path)