diff --git a/src/Phing/Task/Ext/Archive/ZipTask.php b/src/Phing/Task/Ext/Archive/ZipTask.php index c1bcddfe5..c7cd600a8 100644 --- a/src/Phing/Task/Ext/Archive/ZipTask.php +++ b/src/Phing/Task/Ext/Archive/ZipTask.php @@ -306,6 +306,12 @@ private function addFilesetsToArchive($zip) if ($f->isDirectory()) { if ($pathInZip != '.') { $zip->addEmptyDir($pathInZip); + $filePerms = fileperms($f->getPath()); + if (false !== $filePerms) { // filePerms supported + $dirAttrs = $filePerms << 16; + $dirAttrName = $pathInZip . '/'; + $zip->setExternalAttributesName($dirAttrName, \ZipArchive::OPSYS_UNIX, $dirAttrs); + } } } else { $zip->addFile($f->getAbsolutePath(), $pathInZip);