Checking ARexx port availability
Posted: Sat Apr 02, 2016 12:13 pm
I'm planning to make Hollywood programs which would interact with many other programs via their ARexx ports, but I haven't found any functions to check if a port is available yet. It would be needed to check if a program is running, before trying to send ARexx commands randomly to it. Hollywood programs seem to exit with an error message when you send an Arexx command to a non existing port.
With actual ARexx scripts I do that with SHOW('P', 'PORTNAME') and with the Lua implementation in MorphOS with ipc.checkport('portname'), but what could I use with Hollywood?
One workaround could be using the ARexx for that with something like this RunRexxScript("RETURN SHOW('P','JUKEBOX')", True), but it has disadvantages like not working out of the box on MorphOS, because user would need to install 3rd party rexxsyslib.library first, so I'd really prefer a native builtin solution in Hollywood. Is there some obvious function or would this post be better in feature requests?
Edit: actually SendRexxCommand() function seems to require the working ARexx implementation (rexxsyslib.library) too, so it won't work directly under plain MorphOS either. I first thought these would work like the Lua implementation or RXCmd in MorphOS which bypasses the ARexx itself when just sending commands to ARexx ports (when not running any scripts, just send the command and receive the result). Well, this functionality definitely would be a feature request next
Maybe some kind of WaitForPort function could be handy too if you need to wait for a launched program to appear? Like ipc.waitforport(name[, interval]) in MorphOS's Lua implementation.
With actual ARexx scripts I do that with SHOW('P', 'PORTNAME') and with the Lua implementation in MorphOS with ipc.checkport('portname'), but what could I use with Hollywood?
One workaround could be using the ARexx for that with something like this RunRexxScript("RETURN SHOW('P','JUKEBOX')", True), but it has disadvantages like not working out of the box on MorphOS, because user would need to install 3rd party rexxsyslib.library first, so I'd really prefer a native builtin solution in Hollywood. Is there some obvious function or would this post be better in feature requests?
Edit: actually SendRexxCommand() function seems to require the working ARexx implementation (rexxsyslib.library) too, so it won't work directly under plain MorphOS either. I first thought these would work like the Lua implementation or RXCmd in MorphOS which bypasses the ARexx itself when just sending commands to ARexx ports (when not running any scripts, just send the command and receive the result). Well, this functionality definitely would be a feature request next
Maybe some kind of WaitForPort function could be handy too if you need to wait for a launched program to appear? Like ipc.waitforport(name[, interval]) in MorphOS's Lua implementation.