From: Michal Suchanek <hramrach@gmail.com>
To: John McCutchan <ttb@tentacle.dhs.org>,
Robert Love <rml@novell.com>,
linux-kernel@vger.kernel.org
Subject: Not receiving MOVE_TO events with inotify
Date: Wed, 12 Oct 2005 22:26:06 +0200 [thread overview]
Message-ID: <a5d587fb0510121326m7513bfbdn6e77a30da48a7156@mail.gmail.com> (raw)
[-- 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;
}
}
}
reply other threads:[~2005-10-12 20:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5d587fb0510121326m7513bfbdn6e77a30da48a7156@mail.gmail.com \
--to=hramrach@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.com \
--cc=ttb@tentacle.dhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®