cl_stat
functions family.
int cl_statinidir(const char *dirname, struct cl_stat *dbstat); int cl_statchkdir(const struct cl_stat *dbstat); int cl_statfree(struct cl_stat *dbstat);Initialization:
... struct cl_stat dbstat; memset(&dbstat, 0, sizeof(struct cl_stat)); cl_statinidir(dbdir, &dbstat);To check for a change you only need to call
cl_statchkdir
:
if(cl_statchkdir(&dbstat) == 1) { reload_database...; cl_statfree(&dbstat); cl_statinidir(cl_retdbdir(), &dbstat); }Remember to reinitialize the structure after reload.