From jan@swi.psy.uva.nl Tue Jun 26 23:16:30 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f5QLGUc27328;
	Tue, 26 Jun 2001 23:16:30 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f5QLGTB32528;
	Tue, 26 Jun 2001 23:16:29 +0200
Date: Tue, 26 Jun 2001 23:16:29 +0200
Message-Id: <200106262116.f5QLGTB32528@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] how to write on the standard error ?
To: Vincent Manuel Barrilliot <vbarr@cme.nist.gov>, prolog@swi.psy.uva.nl
In-Reply-To: Vincent Manuel Barrilliot's message of Tue, 26 Jun 2001 17:07:25 -0400 (EDT)
Phone: +31 - 20 - 525 6121

> 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

