Writing to Standard Error from gnu-prolog
From: Roger Clayton (see_at_below.for.email)
Date: 04/27/04
- Previous message: Bill Spight: "Re: bubblesort"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Apr 2004 16:53:34 +1200
Hi all,
Hopefully someone can help with this - here's the problem:
I need to write messages to the standard error stream
rather than the standard output from a gnu-prolog program.
(The program is a component of a compiler for a logic
programming language).
Although the gnu-prolog manual is excellent is most cases,
I am having trouble finding the sequence of builtin
predicates to make this happen. Here's a few of observations
I have made so far.
By consulting the interactive environment the available
streams can be found as follows:
==================
| ?- current_stream(X), current_alias(X,Y).
X = '$stream'(0)
Y = top_level_input ? ;
X = '$stream'(0)
Y = user_input ? ;
X = '$stream'(0)
Y = debugger_input ? ;
X = '$stream'(1)
Y = top_level_output ? ;
X = '$stream'(1)
Y = user_output ? ;
X = '$stream'(1)
Y = debugger_output
yes
===================
Because all the output streams are identified by '$stream'(1)
I suspect that all these are actually the same stream and,
moreover, none of these are identified as the standard error.
Setting the stream via the set_output/1 predicate results
in an existence error for anything but '$stream'(1). Creating
a new stream via the open/3 or open/4 calls seems to result
only in a new file being created.
I hope someone out there has had experience with doing this
and can steer me in the right direction. Thanks.
Roger Clayton
rjc4@ waikato .nz
cs. .ac
- Previous message: Bill Spight: "Re: bubblesort"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|