So... I'm totally new to lua and I was able to write a simple program that listen in the foreground for modem_messages and depending on the message, it either responds back or write to a file. Now that I had it working in foreground (using event.pull), I wanted to have it run in driver mode (event.listen). The problem is that now it can't write to the file while in driver mode and I get a "file not found" error if I run.
print(io.open("/tmp/arp.cache", "a"))
Since I also have a message to my assert line, I see that message appended in /tmp/events.log.
Driver mode code: http://pastebin.c