I want to monitor a directory for new file creation in that directory. I found few project in python which are working on top of inotify subsystem like pyinotify, PyInotify and fsmonitor.

I dont want to use these modules because I want to learn by creating something small subset which can only catch newly created file on Linux.

1

There are 1 best solutions below

0
On

If you are particular on using Python, you will have to call(use) a Python library which provides C bindings of the kernel's native inotify C library. This sort of inhibits productive learning. Besides that, if the bindings are not well written, you will wind up traveling the wrong road!

If you don't mind getting your hands dirty with C, inotify man page provides a very good example of a simple implementation. You can pick it up from there on!

Good luck!