|  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: 2019-12-05 16:25 UTC
From: arava dot box at gmail dot com Assigned:
Status: Open Package: Zip Related
PHP Version: 7.3.12 OS: ubuntu 18.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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] <>
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jan 20 15:01:25 2020 UTC