X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Ftrav.c;h=3dff5f56940901387af81224607eac509bacfaa7;hb=1bf3a26f6bb1fc5090047457bf5fd7ae87bc2aae;hp=6ff72497d44bb131fdcd961a7d6cb76e7b175d8c;hpb=6c9fcd3b5d3108702fa1ffc92dab4ab6060f9a19;p=idzebra-moved-to-github.git diff --git a/index/trav.c b/index/trav.c index 6ff7249..3dff5f5 100644 --- a/index/trav.c +++ b/index/trav.c @@ -1,4 +1,4 @@ -/* $Id: trav.c,v 1.47 2005-01-15 19:38:27 adam Exp $ +/* $Id: trav.c,v 1.49 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -27,7 +27,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #define S_ISREG(x) (x & _S_IFREG) #define S_ISDIR(x) (x & _S_IFDIR) -#else +#endif +#if HAVE_UNISTD_H #include #endif #include @@ -312,7 +313,7 @@ static void fileUpdate (ZebraHandle zh, Dict dict, const char *path) else if (S_ISREG(sbuf.st_mode)) { struct dirs_entry *e_dst; - di = dirs_fopen (dict, src); + di = dirs_fopen (dict, src, zh->m_flag_rw); e_dst = dirs_read (di); if (e_dst) @@ -392,6 +393,24 @@ static void repositoryExtractG (ZebraHandle zh, const char *path, repositoryExtract (zh, deleteFlag, path); } +#if 0 +static int dump_file_dict_func(char *name, const char *info, int pos, + void *client) +{ + yaz_log(YLOG_LOG, "%s", name); + return 0; +} +static void dump_file_dict(Dict dict) +{ + int before = 10; + int after = 1000; + char term[1000]; + + strcpy(term, "0"); + dict_scan (dict, term, &before, &after, 0, dump_file_dict_func); +} +#endif + void repositoryUpdate (ZebraHandle zh, const char *path) { assert (path); @@ -412,7 +431,11 @@ void repositoryUpdate (ZebraHandle zh, const char *path) } else fileUpdate (zh, dict, path); +#if 0 + dump_file_dict(dict); +#endif dict_close (dict); + } else repositoryExtractG (zh, path, 0);