Closed clandmeter closed 6 years ago
That sounds strange... Try running the function from a callback inside the handler function:
ioloop:add_handler(function() print("Run executeex here.") end)
It was indeed strange. My own wrong usage of ffi.string().
Sorry for the noise.
I'm trying to trigger a shell command when an inotify event happens. For this I've used turbos inotify.lua implementation using ffi and modified it so it can accept a different mask and is able to return me the actual event->name instead of the directory it is listening on. Because I need to know the exist status of the shell command I've used executeex from the penlight project.
When I execute a shell command ie
pwd
from the add_handler method the result will be:{ true, 0, "", "" }
Instead of getting the result in the 3rd result I will get the result to stdout.Running this from a set_interval method the result would be:
{ true, 0, "/home/clandmeter/test", "" }
It seems that add_handler somehow changes the environment so
executeex
is unable to redirect correctly.