I’m using: SWI-Prolog version 9.1.10 for aarch64-linux
I’m running the following command to spawn an instance of SWI Prolog that I can query from a separate process:
swipl --quiet -g mqi_start -t halt -- --write_connection_values=true
This outputs a string in the format of two numbers separated by a space: a port number and a password. My program reads these values and connects to the SWI process. This works and my program can use the connection to consult Prolog code and query it.
However, in rare cases in the same environment that usually works, the swipl
command only outputs a single number instead (which breaks my program). In addition, when this happens once, it starts happening more consistently thereafter.
Any ideas why might this be the case? Is there some sort of error handling I can add that I’m missing?