1)
write a device driver that creates a file called / dev / special _file.
symlink your text file to / dev / special file
intercept low-level read / write operations to modify a real text file called /path/to/text.txt, then generate a callback through signals or some type of interprocess exchange to any process you want.
2)
you have a way to open a text file and just sit and wait. use select () to determine when this file was modified, then follow the callback procedure.
source share