Bug #15528 Updated: ftell does not work consistently
ID: 15528
Updated by: mfischer@php.net
Reported By: ilia@prohost.org
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Any Windows OS
PHP Version: 4.1.1
New Comment:
That's the way it has been implemented my M$ and it's even documented:
"Note that when a file is opened for appending data, the current file
position is determined by the last I/O operation, not by where the next
write would occur. For example, if a file is opened for an append and
the last operation was a read, the file position is the point where the
next read operation would start, not where the next write would start.
(When a file is opened for appending, the file position is moved to end
of file before any write operation.) If no I/O operation has yet
occurred on a file opened for appending, the file position is the
beginning of the file.
"
Previous Comments:
------------------------------------------------------------------------
[2002-02-12 15:12:02] ilia@prohost.org
In Windows ftell() will ALWAYS return 0, if called right after fopen()
for append, even if the file has data in it.
In UNIX this instead would show the position inside the file and can be
used to determine the filesize prior to writing data.
This happends because of the different implementation of file append in
Windows due to nature of NTFS file system.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15528&edit=1
Thread (2 messages)