File:  [ELWIX - Embedded LightWeight unIX -] / libaitio / example / watchdir.c
Revision 1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Thu Feb 10 21:53:37 2011 UTC (13 years, 4 months ago) by misho
Branches: io1_4
added new test

#include <stdio.h>
#include <string.h>
#include <aitio.h>


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;
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>