Merge pull request #1070 from triska/open_stream
ENHANCED: open/4 to allow opening a stream by specifying stream(S).
This commit is contained in:
@@ -1466,7 +1466,11 @@ open(SourceSink, Mode, Stream, StreamOptions) :-
|
||||
throw(error(uninstantiation_error(Stream), open/4)) % 8.11.5.3f)
|
||||
;
|
||||
parse_stream_options(StreamOptions, [Alias, EOFAction, Reposition, Type], open/4),
|
||||
'$open'(SourceSink, Mode, Stream, Alias, EOFAction, Reposition, Type)
|
||||
( SourceSink = stream(S0) ->
|
||||
'$set_stream_options'(S0, Alias, EOFAction, Reposition, Type),
|
||||
Stream = S0
|
||||
; '$open'(SourceSink, Mode, Stream, Alias, EOFAction, Reposition, Type)
|
||||
)
|
||||
).
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user