php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
---
From manual page: https://php.net/wrappers.compression
---


Test script:
---------------
$sourceHandle = new SplFileObject('zip://file.zip#content.txt', 'r');
//...
$sourceHandle->seek(PHP_INT_MAX);
$sourceHandle->rewind();


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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-05 14:36 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-12-05 14:36 UTC] cmb@php.net
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.

Thx
 [2019-12-05 16:25 UTC] cmb@php.net
-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] cmb@php.net
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] <https://libzip.org/documentation/zip_fseek.html>
 [2020-03-18 13:37 UTC] remi@php.net
-Status: Open +Status: Feedback
 [2020-03-18 13:37 UTC] remi@php.net
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] requinix@php.net
-Status: No Feedback +Status: Wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC