PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » File_Archive » Bug #1899

Adding an existing file to an archive duplicates the file instead of updating i

Details

Submitted2004-07-17 02:01 UTC
Frompeter at kinesissoftware dot com
StatusBogus
PackageFile_Archive
PHP Version4.3.7
OSWin/XP
Roadmaps(Not assigned)

Comments

[2004-07-17 02:01 UTC] peter at kinesissoftware dot com

Description:
------------
I have an archive with a file readme.txt. If I try to update this file by calling $archive->add( 'readme.txt'), the result is two entries in the archive both called readme.txt with exactly the same name and path. This is illegal. Expected behaviour is to update the existing entry with the new file when it already exists.
Workaround is to delete the entry before readding however this will cause a temporary archive to be written twice.

Reproduce code:
---------------
<?php
require 'Zip.php';
$tar_object = new Archive_Zip("install.zip");

$v_list[0]="readme.txt";
echo $tar_object->add($v_list);
?>

Expected result:
----------------
I would expect that when a specified file already exists within the archive. it should update/replace the existing entry.

Actual result:
--------------
The specified file is added to the archive regardless of whether it previously existed. This means that different files with identical paths exist within the archive.

[2007-01-17 02:05 UTC] pfischer at php dot net

Sorry, but your problem does not imply a bug in PEAR itself. For a
list of more appropriate places to ask for help using PEAR, please
visit http://pear.php.net/support/ as this bug system is not the
appropriate forum for asking support questions.

Thank you for your interest in PEAR.

This bug should be on another package (that is unmaintained).