Take the 2-minute tour ×

I am using inotify to monitor changes on some files. The problem is that inotify_event event->name is empty so I cant tell which file was modified

why is event->name empty?

fd = inotify_init();
wd = inotify_add_watch (m_fd, "/tmp/myfile", IN_MODIFY | IN_CREATE | IN_DELETE);
wd1 = inotify_add_watch (m_fd, "/tmp/myfile2", IN_MODIFY | IN_CREATE | IN_DELETE);
unsigned char buffer[BUFFER_SIZE];

    ssize_t len = ACE_OS::read(fd, buffer, sizeof(buffer));
    ssize_t i = 0;

    while (i < len)
            i += EVENT_SIZE + event->len;
share|improve this question

1 Answer 1

From the inotify man page...


Since you're just watching files, and not directories, name will always be empty.

share|improve this answer

Your Answer


