* Not receiving MOVE_TO events with inotify
@ 2005-10-12 20:26 Michal Suchanek
0 siblings, 0 replies; only message in thread
From: Michal Suchanek @ 2005-10-12 20:26 UTC (permalink / raw)
To: John McCutchan, Robert Love, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
Hello
I tried the inotify feature and I found I do not receive MOVE_TO events.
I use linux 2.6.13 from Debian, ext3 filesystem.
I set a watch on /tmp. When I move /tmp/file_a to /tmp/file_b I
receive only one event on file_a (I assume it is move_from, I did not
decode it).
Attaching a small C program that I used to print events that occur on /tmp.
Thanks
Michal Suchanek
--
Support the freedom of music!
Maybe it's a weird genre .. but weird is *not* illegal.
Maybe next time they will send a special forces commando to your picnic ..
.. because they think you are weird.
http://www.music-versus-guns.org http://en.policejnistat.cz
[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 864 bytes --]
#include <linux/inotify.h>
#include <sys/syscall.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
static inline _syscall0(int, inotify_init);
static inline _syscall3(int, inotify_add_watch, int, fd, const char *, path, __u32, mask);
static inline _syscall2(int, inotify_rm_watch, int, fd, int, wd);
#define BUFSIZE 4096
typedef struct inotify_event ine;
int main (int argc, char ** argv)
{
int fd = inotify_init();
int wd = inotify_add_watch(fd, "/tmp", IN_ALL_EVENTS);
static char buf[BUFSIZE];
size_t len;
while(1){
ine * pev;
len = read(fd, buf, BUFSIZE);
if(!len) { putchar('.'); sleep(5); continue;}
pev = (ine *) buf;
while(buf + len > (char *)pev) {
fprintf(stderr, "%s(%u): %x\n", pev->len ? pev->name : "(self)" , pev->wd, pev->mask);
pev = (ine *)((char *)(pev + 1)) + pev->len;
}
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-12 20:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-12 20:26 Not receiving MOVE_TO events with inotify Michal Suchanek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®