cvs: php4 /ext/standard streamsfuncs.c
| From: | Wez Furlong | Date: | Mon, 02 Jun 2003 16:36:10 +0000 |
| Subject: | cvs: php4 /ext/standard streamsfuncs.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-21464@lists.php.net to get a copy of this message | ||
wez Mon Jun 2 12:36:10 2003 EDT
Modified files:
/php4/ext/standard streamsfuncs.c
Log:
Add "seekable" flag to stream_get_meta_data()
# Caveat Emptor: some streams don't know if they are seekable until
# sometime tries to seek first (user streams).
Index: php4/ext/standard/streamsfuncs.c
diff -u php4/ext/standard/streamsfuncs.c:1.13 php4/ext/standard/streamsfuncs.c:1.14
--- php4/ext/standard/streamsfuncs.c:1.13 Wed May 21 09:33:55 2003
+++ php4/ext/standard/streamsfuncs.c Mon Jun 2 12:36:10 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.13 2003/05/21 13:33:55 wez Exp $ */
+/* $Id: streamsfuncs.c,v 1.14 2003/06/02 16:36:10 wez Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -334,6 +334,8 @@
#endif
add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos);
+
+ add_assoc_bool(return_value, "seekable", (stream->ops->seek) &&
(stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0);
if (!php_stream_populate_meta_data(stream, return_value)) {
add_assoc_bool(return_value, "timed_out", 0);