Filed under Threepwood

linuxfd: Announcing inotify Support

Since I don’t have found any straightforward support for inotify in Python 3, I will add it to linuxfd (using the same API as eventfd/timerfd/signalfd). Stay tuned for a new linuxfd release!

More on linuxfd: An Example

The following short test program demonstrates the possibilities of eventfd, signalfd and timerfd in an asynchronous controlled event loop. In short this program features a loop which is activated if any of the three special files becomes readable. Otherwise the epoll call blocks indefinitely. Every three seconds a timer file object expires, thus becoming readable. … Continue reading

Clear sys.stdin Buffer

With epoll() it is possible to detect whether sys.stdin (the standard input character stream) is readable (i.e. someone typed something and concluded with <enter>). Standard input then can be obtained by calling sys.stdin.readline(). But it is not that trivial to get the last input line because sys.stdin is buffered. The user might have entered some … Continue reading

Python Bindings for timerfd.h

For my PhD thesis I’m working on event based control systems. Asynchronous I/O is needed, and so I rely on epoll(), a notification mechanism for file descriptors in Linux systems. As (nearly) everything in Linux can be described as a file, epoll() is able to monitor various I/O interfaces like GPIO or network sockets. It’s … Continue reading