ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Linux-Inotify2/Inotify2.pm
(Generate patch)

Comparing cvsroot/Linux-Inotify2/Inotify2.pm (file contents):
Revision 1.9 by root, Tue Aug 23 02:45:23 2005 UTC vs.
Revision 1.10 by root, Sun Nov 27 12:43:40 2005 UTC

55use Scalar::Util (); 55use Scalar::Util ();
56 56
57use base 'Exporter'; 57use base 'Exporter';
58 58
59BEGIN { 59BEGIN {
60 $VERSION = 0.2; 60 $VERSION = 0.8;
61 61
62 @constants = qw( 62 @constants = qw(
63 IN_ACCESS IN_MODIFY IN_ATTRIB IN_CLOSE_WRITE 63 IN_ACCESS IN_MODIFY IN_ATTRIB IN_CLOSE_WRITE
64 IN_CLOSE_NOWRITE IN_OPEN IN_MOVED_FROM IN_MOVED_TO 64 IN_CLOSE_NOWRITE IN_OPEN IN_MOVED_FROM IN_MOVED_TO
65 IN_CREATE IN_DELETE IN_DELETE_SELF IN_MOVE_SELF 65 IN_CREATE IN_DELETE IN_DELETE_SELF IN_MOVE_SELF
215 215
216 exists $self->{ignore}{$_->{wd}} 216 exists $self->{ignore}{$_->{wd}}
217 and next; # watcher has been canceled 217 and next; # watcher has been canceled
218 218
219 $w->{cb}->(bless $_, Linux::Inotify2::Event); 219 $w->{cb}->(bless $_, Linux::Inotify2::Event);
220 # TODO: what about IN_ONESHOT?
221 $w->cancel if $_->{mask} & (IN_IGNORED | IN_UNMOUNT); 220 $w->cancel if $_->{mask} & (IN_IGNORED | IN_UNMOUNT | IN_ONESHOT);
222 } 221 }
223 222
224 delete $self->{ignore}; 223 delete $self->{ignore};
225 224
226 scalar @ev 225 scalar @ev
264 263
265The received event mask. In addition the the events described for 264The received event mask. In addition the the events described for
266C<$inotify->watch>, the following flags (exported by default) can be set: 265C<$inotify->watch>, the following flags (exported by default) can be set:
267 266
268 IN_ISDIR event object is a directory 267 IN_ISDIR event object is a directory
269
270 IN_Q_OVERFLOW event queue overflowed 268 IN_Q_OVERFLOW event queue overflowed
271 269
272 # when the following flags are set, then watchers are canceled automatically 270 # when any of the following flags are set,
271 # then watchers for this event are automatically canceled
273 IN_UNMOUNT filesystem for watch'ed object was unmounted 272 IN_UNMOUNT filesystem for watch'ed object was unmounted
274 IN_IGNORED file was ignored/is gone (no more events are delivered) 273 IN_IGNORED file was ignored/is gone (no more events are delivered)
274 IN_ONESHOT only one event was generated
275 275
276=item $event->IN_xxx 276=item $event->IN_xxx
277 277
278Returns a boolean that returns true if the event mask matches the 278Returns a boolean that returns true if the event mask matches the
279event. All of the C<IN_xxx> constants can be used as methods. 279event. All of the C<IN_xxx> constants can be used as methods.
280 280
281=item $event->cookie 281=item $event->cookie
282 282
283=item $event->{cookie} 283=item $event->{cookie}
284 284
285The event cookie to "synchronize two events". Currently, this is always 285The event cookie to "synchronize two events". Normally zero, this value is
286zero, and I have no idea what it's supposed use is. Educate me! 286set when two events relating to the same file are generated. As far as I
287know, this only happens for C<IN_MOVED_FROM> and C<IN_MOVED_TO> events, to
288identify the old and new name of a file.
287 289
288=back 290=back
289 291
290=cut 292=cut
291 293

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines