I'm writing a prolog program with an input loop. A good deal of the input is pre-scripted in a response file. I execute this as prolog < response.txt
. When the response file has finished, I would like the program to continue through keyboard user input. However, when the response file finishes, it does not read/1 from the keyboard, but continues to read in an endless loop end_of_file
as its input.
I want the program to revert to user typed input once the pipe has reached the end of the file. How do I do this?
Thanks in advance.