php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81346 Non-seekable streams do not update the position after write
Submitted: 2021-08-10 13:18 UTC Modified: 2021-08-10 13:18 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: Streams related
PHP Version: 7.4Git-2021-08-10 (Git) OS: *
Private report: No CVE-ID: None
 [2021-08-10 13:18 UTC] 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)

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-10 13:18 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2021-08-10 13:38 UTC] cmb@php.net
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
 [2021-08-10 14:52 UTC] git@php.net
Automatic comment on behalf of cmb69
Revision: https://github.com/php/php-src/commit/4a1af1f871d87b569443161ed1bf983d810cecbf
Log: Fix #81346: Non-seekable streams don't update position after write
 [2021-08-10 14:52 UTC] git@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC