Using rb-inotify to monitor file changes

Example

require''def ()notifier=INotifyNotifiernewnotifierwatch/home/james/notes.txt :close_write do||puts""+Timenowto_snotifierstopnew_notifierendnotifierrunendnew_notifier

In the above example the notifier is called from within a recursive method to ensure I am notified everytime the file is saved. I had tried to run a single notifier, however it wouldn't notify me when a file had been saved after the 3rd notice.

Tags:
Source:
1750hrs.txt
Published:
25-11-2013 17:50