php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57111 cannot add a file to existing archive
Submitted: 2006-06-26 17:22 UTC Modified: 2006-06-27 11:38 UTC
From: irokez at gmail dot com Assigned: pajoye (profile)
Status: Closed Package: zip (PECL)
PHP Version: 5.1.2 OS: Windows XP SP1
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:
Package:
Bug Type:
Summary:
From: irokez at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-26 17:22 UTC] irokez at gmail dot com
Description:
------------
I use create.php example from CVS and it works when creating new ZIP archive, but when I attempt to open existing one and add file, Zip::status sets equal to ZIP:ER_RENAME or 2 and archive is not modified (file is not added).

Reproduce code:
---------------
<?php
error_reporting(E_ALL);

$thisdir = dirname(__FILE__);
$filename = $thisdir . "/test112.zip";
$zip = new Zip();

if (!$zip->open($filename/*, ZIP::CREATE*/)) {
	exit("cannot open $filename\n");
} else {
	echo "file $filename OK\n";
}

$zip->addFromString("2.txt", "=)");
$zip->close();
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
?>

Expected result:
----------------
supposed to get:
numfiles: 1
status: 0

Actual result:
--------------
actually get:
numfiles: 1
status: 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-26 17:26 UTC] irokez at gmail dot com
link to archive I use - http://alex.erava.com/files/test112.zip
 [2006-06-26 18:45 UTC] pierre dot php at gmail dot com
Cannot reproduce on linux, I will try tomorrow on windows.
 [2006-06-27 11:38 UTC] pierre dot php at gmail dot com
Fixed in cvs. It should be available in the next windows snaps on pecl4win.php.net
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC