|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78915 Make zip streams seekable
Submitted: 2019-12-05 13:54 UTC Modified: 2020-03-29 05:13 UTC
From: arava dot box at gmail dot com Assigned:
Status: Wont fix Package: Zip Related
PHP Version: 7.3.12 OS: ubuntu 18.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: arava dot box at gmail dot com
New email:
PHP Version: OS:


 [2019-12-05 13:54 UTC] arava dot box at gmail dot com
From manual page:

Test script:
$sourceHandle = new SplFileObject('zip://', 'r');

// SplFileObject::seek(): stream does not support seeking


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-05 14:36 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-12-05 14:36 UTC]
What's the bug you are reporting?  Is it that zip:// streams are
not seekable?  Or is it that this is not documented?
 [2019-12-05 15:55 UTC] arava dot box at gmail dot com
-Status: Feedback +Status: Assigned
 [2019-12-05 15:55 UTC] arava dot box at gmail dot com
Hello. Well, actually both of them. 

zip:// is not seekable, and if that's wrong then why it's not documented.

Anyway, I am wondering to know why compress://zlib is seekable.

 [2019-12-05 16:25 UTC]
-Summary: PHP 7.3.12-1 +Summary: Make zip streams seekable -Status: Assigned +Status: Open -Type: Bug +Type: Feature/Change Request -Assigned To: cmb +Assigned To:
 [2019-12-05 16:25 UTC]
Thanks for the explanation!

I assume that zip streams are not seekable, because fseek()[1] has
only introduced recently (and maybe zip streams are already
seekable if ext/zip has been built against libzip >= 1.2.0?).
Anyhow, that wouldn't be a bug, but rather a feature request.

And yes, the current behavior should be documented anyway.  I'll
see to it, unless somebody else beats me to it.

[1] <>
 [2020-03-18 13:37 UTC]
-Status: Open +Status: Feedback
 [2020-03-18 13:37 UTC]
From libzip documentation: zip_fseek only works on uncompressed (stored) data. When called on compressed data it will return an error.

So doesn't seems to be doable.

I propose to close as wont fix
 [2020-03-29 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2020-03-29 05:13 UTC]
-Status: No Feedback +Status: Wont fix
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Apr 12 23:01:26 2021 UTC