|  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
 [2006-06-26 17:22 UTC] irokez at gmail dot com
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:

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

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

$zip->addFromString("2.txt", "=)");
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-26 17:26 UTC] irokez at gmail dot com
link to archive I use -
 [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
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 12:01:26 2023 UTC