I've been coding a script to transfer some files using lftp. Lftp is launched with exec. From what i searched in this forum seems i have two options:
1- Run exec and wait for transfer to finish and get a sucess return code or failed. In the meanwhile the eggdrop stops responding and if the transfer takes long enough it will timeout from IRC.
2- Run exec in the backgroud and forget about any sucess confirmation or error handling.
3rd option my guess would be to use fileevent with a callback to another proc.
Anyway, I haven't done this before but I recall there was a topic regarding the same issue, like this one. Or you could search the forum with fileevent as keyword.
Once the game is over, the king and the pawn go back in the same box.
Its not working since i get like 10 "Reader" and "Read:" in each second and after a while the lftp process appears as "defunct". From what i understood it means there's something to be read before the precess ends.
I think i may need to close channel inside lftpcallback, but didnt have the time to test it.