#!/usr/bin/tclsh
puts [package require inotify]

puts Instance:[inotify create watch handler]

proc handler {fd} {
    set events [watch read]
    puts $events
    return
}
exec touch 132.txt
watch add 132.txt {w}
after 1000 exec echo 1 >> 132.txt
after 2000 exec echo 1 >> 132.txt
after 3000 exec mv 132.txt 133.txt
after 3500 exec mv 133.txt 132.txt
after 4000 exec rm 132.txt
after 5000 set a 1

set a {}
vwait a
