Subject: Re: [SWIPL] how to write on the standard error ?

From: Jan Wielemaker <[email-masked]>
Date: Tue, 26 Jun 2001 23:16:29 +0200

> Hello,
> 
> I was using SWI 4.0.6 with the Socket library and it worked quite fine but 
> because it was more appropriate in my case, I am now using it through Java by 
> redirecting its standard IO.
> 
> I find it very convenient that SWI-Prolog writes its answers on the stderr ! :-)
> My problem is: how do I write >mine< ?
> I have some predicates that need to return special things, and I want to write 
> them on the standard error so that my Java program can read them.
> 
> I tried write( user, ... ) and write( 2, ... ) without success.

The Prolog stream for stderr is called user_error.  So, use
write(user_error, ...) or generally more convenient 
format(user_error, ...)

	--- Jan