ZipArchive::deleteIndex not working?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
harryd
Forum Newbie
Posts: 4
Joined: Sat Jul 10, 2004 8:03 am

ZipArchive::deleteIndex not working?

Post by harryd »

I'm having problems maintaining a ZIP archive. Deleted entries are not deleted. Any help is appreciated.
<?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;
?>
I am running latest XAMPP on WInXP3.

Thanks!

HarryD
Post Reply