Archive creation does not work on windows (treats all files as links)
---------------------------------------------------------------------
Key: ZETACOMP-71
URL: https://issues.apache.org/jira/browse/ZETACOMP-71
Project: Zeta Components
Issue Type: Bug
Components: Archive
Environment: vista sp2 32bit, php 536 vc9
Reporter: gggeek
When adding files to an archive, all of them are treated as hardlinks. The
archive cannot thus be created successfully. Tested with TAR and ZIP
The problem comes from entry.php:
if ( ezcBaseFeatures::supportsLink() )
{
if ( isset( $inodes[ $struct->ino ] ) )
{
// Yes, it's a hardlink.
$struct->type = ezcArchiveEntry::IS_LINK;
$struct->size = 0;
$struct->link = $inodes[ $struct->ino ];
}
else
{
$inodes[ $struct->ino ] = $struct->path;
}
}
on my pc, $struct->ino is set to 0, hence the test for a hardlink succeeds.
Correct code:
if ( ezcBaseFeatures::supportsLink() )
{
if ( isset( $inodes[ $struct->ino ] ) && $inodes[ $struct->ino
] != 0 )
{
// Yes, it's a hardlink.
$struct->type = ezcArchiveEntry::IS_LINK;
$struct->size = 0;
$struct->link = $inodes[ $struct->ino ];
}
else
{
$inodes[ $struct->ino ] = $struct->path;
}
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira