Linux::Inotify2::IN_CREATE();
$MAIL_GONE = Linux::Inotify2::IN_DELETE() |
Linux::Inotify2::IN_DELETE_SELF() |
- Linux::Inotify2::IN_MOVE_SELF();
+ Linux::Inotify2::IN_MOVE_SELF() |
+ Linux::Inotify2::IN_MOVED_FROM();
$ino_cls = 'Linux::Inotify2';
# Perl 5.22+ is needed for fileno(DIRHANDLE) support:
} elsif ($^V ge v5.22 && eval { require PublicInbox::KQNotify }) {
use Time::HiRes qw(stat);
use PublicInbox::DS qw(add_timer);
sub IN_MODIFY () { 0x02 } # match Linux inotify
+# my $IN_MOVED_FROM 0x00000040 /* File was moved from X. */
# my $IN_MOVED_TO = 0x80;
# my $IN_CREATE = 0x100;
sub MOVED_TO_OR_CREATE () { 0x80 | 0x100 }
sub fullname { ${$_[0]} }
sub IN_DELETE { 0 }
+sub IN_MOVED_FROM { 0 }
sub IN_DELETE_SELF { 0 }
package PublicInbox::FakeInotify::GoneEvent;
our @ISA = qw(PublicInbox::FakeInotify::Event);
sub IN_DELETE { 1 }
+sub IN_MOVED_FROM { 0 }
package PublicInbox::FakeInotify::SelfGoneEvent;
use strict;
my $fn = $ev->fullname;
if ($fn =~ m!\A(.+)/(new|cur)/([^/]+)\z!) { # Maildir file
my ($mdir, $nc, $bn) = ($1, $2, $3);
- $nc = '' if $ev->IN_DELETE;
+ $nc = '' if $ev->IN_DELETE || $ev->IN_MOVED_FROM;
for my $f (keys %{$MDIR2CFGPATH->{$mdir} // {}}) {
my $cfg = $PATH2CFG{$f} // next;
eval {