({{, (RefLink[SetStreamPosition, paclet:ref/SetStreamPosition])[stream,n]
sets the current point in an open stream. }})

OpenersNotesSection(Spacer1)Details

The integer n given to (RefLink[SetStreamPosition, paclet:ref/SetStreamPosition]) should usually be a value obtained from (RefLink[StreamPosition, paclet:ref/StreamPosition]).

(RefLink[SetStreamPosition, paclet:ref/SetStreamPosition])[stream,0] sets the current point to the beginning of a stream.

(RefLink[SetStreamPosition, paclet:ref/SetStreamPosition])[stream,(RefLink[Infinity, paclet:ref/Infinity])] sets the current point to the end of a stream.

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Open a stream:

str=StringToStream["123 456 789"]

Read the first number from the stream object:

Read[str,Number]

Modify the current point in the stream:

SetStreamPosition[str,7]

Read a number from the stream object:

Read[str,Number]

Close the stream:

Close[str]

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

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Searching Files, paclet:tutorial/SearchingFiles])}, {▪(RefLinkPlain[Streams and Low-Level Input and Output, paclet:tutorial/StreamsAndLowLevelInputAndOutput])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[String Operations, paclet:guide/StringOperations])}, {▪(RefLinkPlain[Files, paclet:guide/Files])}, {▪(RefLinkPlain[Low-Level File Operations, paclet:guide/LowLevelFileOperations])}})}})