#50349 [Opn->Fbk]: Problem with the function ZipArchive::deleteName()
| From: | pajoye@php.net | Date: | Tue, 01 Dec 2009 09:58:31 +0000 |
| Subject: | #50349 [Opn->Fbk]: Problem with the function ZipArchive::deleteName() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145269@lists.php.net to get a copy of this message | ||
ID: 50349
Updated by: pajoye@php.net
Reported By: c dot hugot at uniteam dot fr
-Status: Open
+Status: Feedback
Bug Type: Zip Related
Operating System: windows xp with wamp
PHP Version: 5.3SVN-2009-12-01 (SVN)
-Assigned To:
+Assigned To: pajoye
New Comment:
Please provide a script we can use to reproduce your problem, not only
a function.
Previous Comments:
------------------------------------------------------------------------
[2009-12-01 09:15:20] c dot hugot at uniteam dot fr
In the code $_SESSION['step5'][$p_sName . '_name'] is the name of the
file, that is in the archive file ($_SESSION['step5']['zip_name'] .
".zip" = the name of the archive file), and RACCORDEMENT_ZIP_FILE_PATH
is the constant, that contained the path to the archive file.
I hope, that could help you to solve my problem. Thanks for your work.
Best regards.
------------------------------------------------------------------------
[2009-12-01 08:58:03] jani@php.net
Is that self-contained? I don't have your session available.
------------------------------------------------------------------------
[2009-12-01 08:53:46] c dot hugot at uniteam dot fr
<?php
private function myDelZipFile($p_sName){
$l_oZip = new ZipArchive();
if($l_oZip->open(RACCORDEMENT_ZIP_FILE_PATH . "/" .
$_SESSION['step5']['zip_name'] . ".zip", ZIPARCHIVE::OVERWRITE) ===
true){
$l_oZip->deleteName( $_SESSION['step5'][$p_sName.'_name']);
$l_oZip->close();
return true;
}
return false;
}
?>
------------------------------------------------------------------------
[2009-12-01 08:49:00] jani@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2009-12-01 08:45:39] c dot hugot at uniteam dot fr
Description:
------------
I create an archive (.zip) with class ZipArchive, with four files into.
And when I want to delete the last file, in this archive, the function
deleteName() return true, but the file is not remove from the archive.
The three others files were correctly remove, but not the last.
Reproduce code:
---------------
---
From manual page: function.ziparchive-deletename
---
private function myDelZipFile($p_sName){
$l_oZip = new ZipArchive();
if($l_oZip->open(RACCORDEMENT_ZIP_FILE_PATH . "/" .
$_SESSION['step5']['zip_name'] . ".zip", ZIPARCHIVE::OVERWRITE) ===
true){
$l_oZip->deleteName( $_SESSION['step5'][$p_sName .
'_name']) === true;
$l_oZip->close();
return true;
}
return false;
}
Expected result:
----------------
The archive file ever contained the last file.
Actual result:
--------------
The archive would be empty.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50349&edit=1