|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-06-06 17:46 UTC] artem at w510 dot tm dot odessa dot ua
after installing 4.3.2
$fr = fopen("filename", "a");
$pointer = ftell($fr);
points to 0! forced to add
fseek($fr, 0, SEEK_END);
$pointer = ftell($fr);
to move to the file end
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 15:00:01 2025 UTC |
From code at php-src/main/streams/streams.c:1693 (revision 1.61) it seems that this is supposed to work (but doesn't). 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; } } If it will be fixed, reclasify this back to docprob so we can add a note that it works since version x.x.x. (Spotted by dave@php.net.)