Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5.  
  6. $|++;
  7.  
  8. use Linux::Inotify2;
  9.  
  10. my $this1 = new Linux::Inotify2
  11. or die "unable to create new inotify object: $!";
  12. $this1->watch ("/tmp/a12", IN_MODIFY, sub {
  13. my $e = shift;
  14. print "\nin watch - $e = \n";
  15.  
  16. });
  17.  
  18. $this1->poll;
  19.  
  20.  
  21. If I run this and there is a file /tmp/a12, on ubuntu 18.4 I get the event
  22. if I then: touch -m /tmp/a12. On ubuntu 16.4 I do not.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement