--- libaitio/example/watchdir.c 2011/02/10 21:53:37 1.1 +++ libaitio/example/watchdir.c 2011/02/10 21:53:37 1.1.2.1 @@ -0,0 +1,37 @@ +#include +#include +#include + + +int +show(const char *csName, int nOp) +{ + switch (nOp) { + case -1: + printf("Delete %s\n", csName); + break; + case 0: + printf("Move %s\n", csName); + break; + case 1: + printf("Create %s\n", csName); + break; + default: + printf("Unknown code ??? %d\n", nOp); + return -1; + } + + return 0; +} + +int +main(int argc, char **argv) +{ + + if (argc < 2) + return 1; + + printf("events=%d\n", ioWatchDirLoop(argv[1], show)); + + return 0; +}