Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets file permissions
<?php fileperms(string $filename): int|false
<?php     protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)

    {

        $io = $this->getIO();

        @chmod($newFilename, fileperms($localFilename));




        if (!$this->validatePhar($newFilename, $error)) {
<?php                 if (method_exists($zip, 'setExternalAttributesName')) {

                    $perms = fileperms($filepath);
<?php             if ($originIsLocal) {


                @chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));



                if ($bytesCopied !== $bytesOrigin = filesize($originFile)) {

                    throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile);
<?php                 throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);

            }



            @chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());



            $this->rename($tmpFile, $filename, true);

        } finally {