Bug #81346 [PATCH]: Non-seekable streams do not update the position after write

From: Date: Tue, 10 Aug 2021 13:38:51 +0000
Subject: Bug #81346 [PATCH]: Non-seekable streams do not update the position after write
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235734@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81346&edit=1

 ID:                 81346
 Patch added by:     cmb@php.net
 Reported by:        cmb@php.net
 Summary:            Non-seekable streams do not update the position
                     after write
 Status:             Assigned
 Type:               Bug
 Package:            Streams related
 Operating System:   *
 PHP Version:        7.4Git-2021-08-10 (Git)
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

The following pull request has been associated:

Patch Name: Fix #81346: Non-seekable streams don't update position after write
On GitHub:  https://github.com/php/php-src/pull/7356
Patch:      https://github.com/php/php-src/pull/7356.patch


Previous Comments:
------------------------------------------------------------------------
[2021-08-10 13:18:00] cmb@php.net

Description:
------------
When writing to a non-seekable stream, the stream position is not
properly updated, what can be whitnessed by ftell().

The seemingly strange expected output is due to bug #81345.

Test script:
---------------
<?php
$s = fopen("compress.bzip2://file.bz2", "w");
fwrite($s, str_repeat("hello world", 100));
fflush($s);
var_dump(ftell($s));
?>

Expected result:
----------------
int(1100)

Actual result:
--------------
int(0)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81346&edit=1


Thread (3 messages)

« previous php.bugs (#235734) next »