WOLFRAM

StreamPosition[stream]

returns an integer that specifies the position of the current point in an open stream.

Details

  • On most computer systems, the integer returned by StreamPosition gives the position counting from the beginning of the file in bytes.

Examples

Basic Examples  (1)Summary of the most common use cases

Open a stream:

Out[1]=1

Read the first number from the stream object:

Out[2]=2

The position counting from the beginning of the stream:

Out[3]=3

Close the stream:

Out[4]=4
Wolfram Research (1991), StreamPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/StreamPosition.html.
Wolfram Research (1991), StreamPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/StreamPosition.html.

Text

Wolfram Research (1991), StreamPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/StreamPosition.html.

Wolfram Research (1991), StreamPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/StreamPosition.html.

CMS

Wolfram Language. 1991. "StreamPosition." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StreamPosition.html.

Wolfram Language. 1991. "StreamPosition." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StreamPosition.html.

APA

Wolfram Language. (1991). StreamPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StreamPosition.html

Wolfram Language. (1991). StreamPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StreamPosition.html

BibTeX

@misc{reference.wolfram_2025_streamposition, author="Wolfram Research", title="{StreamPosition}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/StreamPosition.html}", note=[Accessed: 19-June-2025 ]}

@misc{reference.wolfram_2025_streamposition, author="Wolfram Research", title="{StreamPosition}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/StreamPosition.html}", note=[Accessed: 19-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_streamposition, organization={Wolfram Research}, title={StreamPosition}, year={1991}, url={https://reference.wolfram.com/language/ref/StreamPosition.html}, note=[Accessed: 19-June-2025 ]}

@online{reference.wolfram_2025_streamposition, organization={Wolfram Research}, title={StreamPosition}, year={1991}, url={https://reference.wolfram.com/language/ref/StreamPosition.html}, note=[Accessed: 19-June-2025 ]}