ZipArchive::deleteName() not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

ZipArchive::deleteName() not working

Postby harryd » 21. September 2009 09:32

The code below behaves unexpectedly: it tries to delete an entry from an archive, but it does not get deleted. I ran the same code on a Linux server and it works fine. Any suggestions?
<?php
$fname='somefile.txt';
$z=new ZipArchive;
$z->open('somearchive.zip');

echo "<p>before: ".$z->getFromName($fname); // shows the contents as expected
$res=$z->deleteName($fname); // $res is true!
echo "<p>after: ".$z->getFromName($fname); // shows no content, as expected
$z->close;

$z=new ZipArchive;
$z->open('somearchive.zip');
echo "<p>and again: ".$z->getFromName($fname); // shows contents. Quite unexpected.
$z->close;
?>
harryd
 
Posts: 3
Joined: 21. September 2009 09:17

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests