PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Archive_Tar » Bug #8702

Directory case not obeyed / preserved

Details

Submitted2006-09-14 15:45 UTC
Fromtim at skypanther dot com
StatusBogus
PackageArchive_Tar
PHP VersionIrrelevant
OSVarious *nix
Roadmaps(Not assigned)

Comments

[2006-09-14 15:45 UTC] tim at skypanther dot com

Description:
------------
Let's say you have two directories: dir1 and Dir1. In the resulting tar file, the contents of these two directories are merged into a single directory.

(The same problem exists in the Zip package.)

Test script:
---------------
require_once('PEAR.php');
require_once('Tar.php');
$zip = new Archive_Tar( 'testfile.gz', 'gz');

// these files/dirs are created manually on the web server
$fileArray[] = 'test.txt';
$fileArray[] = 'test'; // should contain a unique file
$fileArray[] = 'Test'; // also should contain a file

$zip->add($fileArray);

Expected result:
----------------
Resulting gz file should contain a test and Test directory, each with its original file.

Actual result:
--------------
The gz file contains just a "test" directory which contains the files originally in Test and test.

[2006-10-23 14:12 UTC] tim at skypanther dot com

Nevermind. The archives are just fine. What you see inside an archive depends on the client OS. So, if you create a tar/gz file that contains directories dir1 and Dir1 on a case-sensitive OS but open the archive on a case-insensitive OS (Windows) you see the directories merged. But, if you open it on a case-sensitive OS, the original directories are preserved.