[gamin] Regarding absolute paths



Hello,

I found out about Gamin when I was looking for a library that could handle inotify hooks in Python.

Gamin is working nicely, and reports changes in the directory structure quite fast. However, it seems to pass both absolute and relative paths as a feedback in the callback events. Is there any way to alter this behavior? Or is there any "best practice" to reconstruct the absolute path from the relative paths given?

Example:

>>> import gamin
>>> def callback(path, event):
...	print path, event
>>> monitor = gamin.WatchMonitor()
>>> monitor.watch_directory('/tmp/test', callback)

[... now in another shell, I create /tmp/test/foo ...]

>>> monitor.handle_events()
>>> monitor.stop_watch('/tmp/test')

This results in:

    bar 5

While I would like to find out that this was "/tmp/test/foo". In the full project I am registering about 5000 paths to monitor.

Regards,

Wijnand Modderman

 [_][O][_]                Wijnand "maze" Modderman
 [_][_][O]     HAR2009 - Help making it happen and volunteer!
 [O][O][O]  http://wiki.har2009.org/index.php?title=Participation



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]