Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/test/t_notify.c
Henrik Hautakoski f46ae1970b Change indentation to follow the updated standard.
Alot of mixed indentation. use 4 chars wide soft tabs.
2011-03-19 12:28:48 +02:00

37 lines
705 B
C

#include <stdio.h>
#include "../src/notify.h"
int main(int argc, char *argv[]) {
notify_event *event;
if (argc < 2)
return 1;
notify_init();
if (!notify_add_watch(argv[1]))
return 1;
printf("begin watching on: %s\n", argv[1]);
for (;;) {
event = notify_read();
if (event == NULL)
continue;
printf("====================\n"
"Type: %s\n"
"Path: %s\n"
"Filename: %s\n"
"Directory: %u\n"
"====================\n"
, notify_event_typetostr(event), event->path,
event->filename, event->dir);
}
return 0;
}