The Samba-Bugzilla – Attachment 5927 Details for
Bug 7646
Change notify don't work recursively
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Linux directory watch using inotify
fswatch.c (text/plain), 806 bytes, created by
Benjamin Kalytta
on 2010-08-26 05:20:43 UTC
(
hide
)
Description:
Linux directory watch using inotify
Filename:
MIME Type:
Creator:
Benjamin Kalytta
Created:
2010-08-26 05:20:43 UTC
Size:
806 bytes
patch
obsolete
>#include <sys/inotify.h> >#include <stdio.h> >#include <malloc.h> >#include <unistd.h> > >int main(int argc, char* argv[]) { > printf("Start watching changes...\n"); > > int fds = inotify_init(); > > int watchds = inotify_add_watch(fds, "/home/kalyttab", IN_MODIFY | IN_ATTRIB | IN_MOVED_FROM | IN_MOVED_TO | IN_DELETE | IN_CREATE); > > struct inotify_event* event = malloc(4096); > > printf("Watch Descriptor: %x, File Descriptor: %x\n", watchds, fds); > > int count = 0; > > while ((count = read(fds, event, 4096)) > 0) { > struct inotify_event* event_ptr = event; > while (count > 0) { > printf("Event %x occured in \"%s\", Cookie: %x\n", event_ptr->mask, event_ptr->name, event_ptr->cookie); > int size = offsetof(struct inotify_event, name) + event_ptr->len; > count -= size; > } > } > > close(fds); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7646
:
5926
| 5927