Bug #15528 Updated: ftell does not work consistently

From: Date: Tue, 12 Feb 2002 22:07:28 +0000
Subject: Bug #15528 Updated: ftell does not work consistently
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213@lists.php.net to get a copy of this message
 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)

« previous php.bugs (#213) next »