miyagawa (owner)

Revisions

gist: 212939 Download_button fork
public
Public Clone URL: git://gist.github.com/212939.git
Embed All Files: show embed
fsevents-ae.pl #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent;
use Mac::FSEvents;
 
my $fs = Mac::FSEvents->new({ path => "/", latency => 0.2 });
my $fh = $fs->watch;
my $cv = AE::cv;
 
my $io; $io = AE::io $fh, 0, sub {
    for my $event ($fs->read_events) {
        printf "Directory %s changed\n", $event->path;
    }
    undef $io;
    $fs->stop;
    $cv->send;
};
 
$cv->recv;
 
Text only #
1
2
3
4
5
6
7
~/tmp/fsevents-anyevent.pl
Directory /private/var/log/ changed
perl(79958,0xa025c720) malloc: *** error for object 0x63614d2a: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
perl(79958,0xa025c720) malloc: *** error for object 0x80068c: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug