Jakub Vrana wrote:

vrana           Sat Aug  7 04:56:21 2004 EDT

Modified files: /phpdoc/en/reference/filesystem/functions ftell.xml Log:
Can't use ftell with a (bug #24071)

I looked into this yesterday, and if you look at the following code fragment, you'll see that ftell() probably IS meant to work on append streams:


if (stream && stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && strchr(mode, 'a') && stream->position == 0) {
off_t newpos = 0;


/* if opened for append, we need to revise our idea of the initial file position */
if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos TSRMLS_CC)) {
stream->position = newpos;
}
}


But for some reason it doesn't work. Maybe you should reclassify as a streams bug? :)

Dave

Reply via email to