I am new to Eclipse, and I have been trying to read a file stream without success. The code that I normally use for this in SWI-Prolog is this:
read_until_stop(File, [L|Lines]) :-
read_line_to_codes(File, Codes),
Codes \= end_of_file,
atom_codes(L, Codes),
L \= stop,
!,
read_until_stop(File, Lines).
read_until_stop(_, []).
But read_line_to_codes
is not available in Eclipse apparently. What is a good alternative for this?
As suggested by the Eclipse manual the Eclipse counterpart would be
with the difference that read_string returns the actual string as opposed to the list of codes, i.e.,
atom_codes
is no longer necessary: