order and timing of events

From: Richard Hector <richard_at_catalyst.net.nz>
Date: Mon, 14 Sep 2009 13:41:11 +1200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I've been playing with inotify, attempting (as many seem to) to set up
watches recursively. I'm currently using the Perl module
Linux::Inotify2, in the callback structure.

Can anyone tell me what guarantees there are about the ordering and
timing of notifications, where there is more than one notification for
the same event?

In particular, I'm thinking of the case where I have a watch on
directory A, and subdirectory B gets renamed (moved to a new name, still
 a child of A).
That will generate 3 'events': A:IN_MOVED_FROM, A:IN_MOVED_TO, and
B:IN_MOVED_SELF.

In order to know what to do about that, I need to know about all of
them. But once I've received the first, how long do I need to wait (a
simple timeout is ugly anyway) to know that no other notifications are
going to arrive for this event? If B was moved outside A (and entirely
outside the tree I'm watching) for example, I'll only get
A:IN_MOVED_FROM and B:IN_MOVED_SELF. In that case, I'd need to cancel
the watch on B.

Do I have to resort to parsing the actual filenames to work out what
happened?

Any help appreciated.

Thanks,

Richard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqtnywACgkQutl99ydRq9dISACffQSdk3PARnpxbNY9qcXqHMq4
10kAoKPqCz0NVzqAeejYTn0aDpkoaVY5
=U7Na
-----END PGP SIGNATURE-----
Received on Tue Jun 05 2012 - 22:14:21 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST