[bp-users]at_end_of_stream/1 not detecting end of file.

Douglas R. Miles dmiles@teknowledge.com
Fri, 23 Nov 2001 22:06:21 -0800


Hi,

With the given program:

term_to_atom(T,A):-
	open(term_to_atom,write,W,[type(binary)]),
	writeq(W,T),
	close(W,[force(true)]),
	open(term_to_atom,read,R),
	get_all_codes(R,Codes),
	atom_codes(A,Codes),
	close(R,[force(true)]).
=09
get_all_codes(R,[]):-at_end_of_stream(R),!.
get_all_codes(R,[C|Odes]):-
	get_code(R,C),
	get_all_codes(R,Odes),!.

ttta:-term_to_atom('T'(A),X),nl,writeq(X),nl.

What is happing here?

| ?- ttta.
'T'(_401820a4)=FF
yes
| ?- ttta.

yes

It looks like at_end_of_stream/1 is not working
given: =FF =3D (-1)

the second call to ttta/0 fails due to the stream closing also having =
an
issue.

Is this known?



Thank you,
  Douglas