Logical streams may be matched to their physical stream numbers by using get_stream/2.
Stream can be any existing stream number or symbolic stream name as long as it has a mode compatible with that of StreamId.
StreamId can be a user-defined symbolic stream name, or else one of the system systems: input , output , error, user, warning_output, log_output.
A user-defined symbolic stream is not automatically updated when the stream to which it points is changed or closed.
Success:
[eclipse]: open(file1,update,s), set_stream(output,s),
> writeln(output,hi), flush(output).
yes.
[eclipse]: seek(s,0), read(s,X).
X = hi
yes.
Error:
set_stream(a, S). (Error 4).
set_stream(1.0, S). (Error 5).
set_stream(a, nonex). (Error 193).