how to get stream length or caret position in php?

php, stream

Solution

`fstat` to the rescue!

30 characters limit is non-sense

Problem

That is count all data in a stream without bringing it all to a string. Or maybe doing it two step, that is bring caret to end and then get position ? http://www.php.net/manual/en/ref.stream.php - I cant find any reference to caret position or size or length.

Original source