From:             xl269 at cam dot ac dot uk
Operating system: Debian GNU/Linux lenny
PHP version:      5.3.0alpha2
PHP Bug Type:     PHAR related
Bug description:  addEmptyDir() breaks

Description:
------------
PharData::addEmptyDir() on a tar archive adds empty files instead of
directories.




Reproduce code:
---------------
$zip = new PharData('test.tar');
$zip = $zip->convertToData(Phar::TAR, Phar::NONE); // compression scheme
does not affect the result.
// Phar::ZIP is not buggy, but you need to add a file to the empty
directory to see this.
$zip->startBuffering();
$zip->addEmptyDir('test/');
// $zip->addFile('file', 'test/file'); // see (*)
$zip->stopBuffering();


Expected result:
----------------
test.tar.bz2 should contain 1 empty directory "test"


Actual result:
--------------
test.tar.bz2 contains 1 empty *file* "test"

(*) doing this will create the directory "test" automatically, so that the
tar archive now contains both a file and a directory called "test", and
becomes unextractable.


-- 
Edit bug report at http://bugs.php.net/?id=46060&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46060&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46060&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46060&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46060&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46060&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46060&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46060&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46060&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46060&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46060&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46060&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46060&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46060&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46060&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46060&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46060&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46060&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46060&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46060&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46060&r=mysqlcfg

Reply via email to