11
expect = [gamin.GAMExists, gamin.GAMEndExist]
13
def callback(path, event):
14
global top, expect, ok
15
# print "Got callback: %s, %s" % (path, event)
16
if expect[top] != event:
17
print "Error got event %d expected %d" % (event, expect[top])
21
shutil.rmtree ("temp_dir", True)
23
open("temp_dir/a", "w").close()
24
os.chmod ("temp_dir", 0000)
25
mon = gamin.WatchMonitor()
26
mon.watch_directory("temp_dir", callback)
29
mon.stop_watch("temp_dir")
32
os.chmod ("temp_dir", 0755)
33
shutil.rmtree ("temp_dir", True)
35
print "Error: top monitor got %d events insteads of 4" % (top)