I want to write a listener (ruby module) to identify a file creation inside a folder. My scenario is as follows
- I have a folder called (files)
- I have a Rails project which will create a file (demo.txt) inside
the folder (‘file’) - I need to write a listener to identify the file change and start
reading the file (demo.txt)
Where can I start on creating this Ruby module?
I’m using ‘Ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]’.
There are a few small libraries, which you could utilize, learn from or build upon, e.g.