Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.5

Bug #12448 Empty directories removed when extracting .tar.gz
Submitted: 2007-11-14 17:50 UTC Modified: 2008-06-04 10:56 UTC
From: michaelkirk Assigned: cbrunet
Status: Closed Package: File_Archive (version 1.5.3)
PHP Version: 5.2.3 OS: Ubuntu
Roadmaps: (Not assigned)    
Subscription  


 [2007-11-14 17:50 UTC] michaelkirk (Michael Kirk)
Description: ------------ When a tar.gz file is extracted, empty directories are removed from the archive (or not extracted?) Test script: --------------- // Uploaded file stored in $_FILES['submitted_file'] $reader = File_Archive::readUploadedFile('submitted_file'); $archive = File_Archive::readArchive('.tar.gz', $naive_reader ); $writer = File_Archive::appender($unpack_directory); File_Archive::extract($archive, $writer);

Comments

 [2007-11-14 20:58 UTC] cwiedmann (Carsten Wiedmann)
Hello, from what I see, this test script can't work. > $archive = File_Archive::readArchive('.tar.gz', > $naive_reader ); - ".tar.gz" is no valid parameter for the $extension parameter - "$naive_reader" should be "$reader"? Did you have a working example for verification? Regards, Carsten
 [2007-11-15 07:18 UTC] cwiedmann (Carsten Wiedmann)
Well, have found your problem. That's my testscript: | <?php | $fieldname = 'submitted_file'; | $archivtype = 'tgz'; //'.tar.gz' | $targetdir = './uploadfiles'; //$unpack_directory | | $upload = File_Archive::readUploadedFile($fieldname); | $archiv = File_Archive::readArchive($archivtyp, $upload); | $target = File_Archive::toFiles($targetdir); | $result = $archiv->extract($target, $archiv); | ?> - you must download File_Archive from CVS - you must apply the attached patch - install the patched CVS version Regards, Carsten
 [2008-06-04 10:56 UTC] cbrunet (Charles Brunet)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.