OpenersNotesSection(Spacer1)Details

This message is generated when the first argument in (RefLink[InputStream, paclet:ref/InputStream]) or (RefLink[OutputStream, paclet:ref/OutputStream]) is neither a string representing the name of a file nor an identifier for a string that is used as a stream.

This message is normally seen only when attempting to enter (RefLink[InputStream, paclet:ref/InputStream]) or (RefLink[OutputStream, paclet:ref/OutputStream]) expressions explicitly, rather than using the expressions that have been generated by the Wolfram Language.

(RefLink[Off, paclet:ref/Off])[message] switches off the message; (RefLink[On, paclet:ref/On])[message] switches it on. For example: (RefLink[Off, paclet:ref/Off])[General::strmi].

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

The first argument in (RefLink[OutputStream, paclet:ref/OutputStream]) is not a string:

strm=OpenWrite["TEST"]

Write[OutputStream[TEST,3],OutputForm["output to file"]]

Output can be written to the open stream by giving the name of the file or by using the corresponding (RefLink[OutputStream, paclet:ref/OutputStream]) expression:

Write[strm,OutputForm["output to file"]]

Write["TEST",OutputForm["more output to file"]]

Close the stream and delete the file:

Close[strm];DeleteFile["TEST"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[General, paclet:ref/General])}})}})