25 #include <sys/types.h>
28 #define S_ISREG(x) (x & _S_IFREG)
29 #define S_ISDIR(x) (x & _S_IFDIR)
45 size_t rep_len = strlen(rep);
50 yaz_log(YLOG_LOG,
"dir %s", rep);
51 if (rep[rep_len-1] !=
'/')
56 for (i=0; e[i].
name; i++)
59 strcpy(rep +rep_len+1, e[i].
name);
60 if ((ecp = strrchr(e[i].
name,
'/')))
87 yaz_log(YLOG_FATAL,
"dict_open fail of %s",
FMATCH_DICT);
91 strncpy(src, path,
sizeof(src)-1);
92 src[
sizeof(src)-1]=
'\0';
93 src_len = strlen(src);
95 if (src_len && src[src_len-1] !=
'/')
98 src[++src_len] =
'\0';
104 yaz_log(YLOG_LOG,
"%s", dst->
path);
120 if (zh->
path_reg && !yaz_is_abspath(path))
133 yaz_log(YLOG_WARN|YLOG_ERRNO,
"Cannot access path %s", src);
134 else if (S_ISREG(sbuf.st_mode))
136 else if (S_ISDIR(sbuf.st_mode))
139 yaz_log(YLOG_WARN,
"Skipping path %s", src);
146 if (!strcmp(path,
"") || !strcmp(path,
"-"))
150 while (scanf(
"%1020s", src) == 1)
int dict_close(Dict dict)
closes dictionary
struct dir_entry * dir_open(const char *rep, const char *base, int follow_links)
int zebra_file_stat(const char *file_name, struct stat *buf, int follow_links)
void dir_free(struct dir_entry **e_p)
void dirs_free(struct dirs_info **pp)
struct dirs_entry * dirs_read(struct dirs_info *p)
struct dirs_info * dirs_open(Dict dict, const char *rep, int rw)
Dict dict_open_res(BFiles bfs, const char *name, int cache, int rw, int compact_flag, Res res)
struct zebra_register * reg
ZEBRA_RES zebra_update_from_path(ZebraHandle zh, const char *path, enum zebra_recctrl_action_t action)
static void repositoryExtractR(ZebraHandle zh, char *rep, int level, enum zebra_recctrl_action_t action)
static void repositoryExtract(ZebraHandle zh, const char *path, enum zebra_recctrl_action_t action)
void repositoryShow(ZebraHandle zh, const char *path)
short ZEBRA_RES
Common return type for Zebra API.