At the moment, what you are currently doing is one of the simplest ways
of doing it portably, provided that the stream is seekable.
The other way is to call php_stream_stat() which returns the size,
ctime, mtime etc. of the stream, and can theoretically work on virtual
filesystems and wrappers (if
wez,
what's the most portable way to get the size of a stream ? right now im
using
stream = php_stream_open_wrapper ( path, mode, options, opened);
php_stream_seek ( stream, SEEK_END, SEEK_CUR);
size = php_stream_tell(stream);
note that i have to also process the files, so i rewind immediately