note 38499 added to function.ftell
| From: | php-general at lists dot php dot net | Date: | Wed, 24 Dec 2003 12:17:21 +0000 |
| Subject: | note 38499 added to function.ftell | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62409@lists.php.net to get a copy of this message | ||
[quote]
Another (and more convenient) way to make ftell() to return a true pointer for appended file is just
issue fseek() before:
$n=fopen($name,'a+'); // open for append
echo ftell($n); // 0
fseek($n, 0 , SEEK_END); // set to EOF... hm! and where we was before?
echo ftell($n); // 3547843 or something :)
jz
[/quote]
To get the true pointer for an appended local file you better just get the filesize!
echo filesize($file);
----
Manual Page -- http://www.php.net/manual/en/function.ftell.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38499
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38499&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38499&report=yes
Search -- http://master.php.net/manage/user-notes.php