src/Path.php
public static function getPermissions($path)
    {
        try
        {
            $mode = @fileperms($path);
            if ($mode === false)
                throw new IOException();
        }
        catch (Throwable $e)
        {
            throw new IOException("Could not stat: " . $path);
        }

        $perms = array(
            'owner' => array(
                'read'    => (bool)($mode & 0x0100),
                'write'   => (bool)($mode & 0x0080),
                'execute' => (bool)($mode & 0x0040)
            ),
            'group' => array(
                'read'    => (bool)($mode & 0x0020),
                'write'   => (bool)($mode & 0x0010),
                'execute' => (bool)($mode & 0x0008)
            ),
            'world' => array(
                'read'    => (bool)($mode & 0x0004),
                'write'   => (bool)($mode & 0x0002),
                'execute' => (bool)($mode & 0x0001)
            )
        );

        $perms['mode'] = self::compileMode($perms);
        return $perms;
    }
public static function getPermissions($path)
    {
        try
        {
            $mode = @fileperms($path);
            if ($mode === false)
                throw new IOException();
        }
        catch (Throwable $e)
        {
            throw new IOException("Could not stat: " . $path);
        }

        $perms = array(
            'owner' => array(
                'read'    => (bool)($mode & 0x0100),
                'write'   => (bool)($mode & 0x0080),
                'execute' => (bool)($mode & 0x0040)
            ),
            'group' => array(
                'read'    => (bool)($mode & 0x0020),
                'write'   => (bool)($mode & 0x0010),
                'execute' => (bool)($mode & 0x0008)
            ),
            'world' => array(
                'read'    => (bool)($mode & 0x0004),
                'write'   => (bool)($mode & 0x0002),
                'execute' => (bool)($mode & 0x0001)
            )
        );

        $perms['mode'] = self::compileMode($perms);
        return $perms;
    }
public static function getPermissions ( $ path ) { try { $ mode = @ fileperms ( $ path ) ; if ( $ mode === false ) throw new IOException ( ) ; } catch ( Throwable $ e ) { throw new IOException ( "Could not stat: " . $ path ) ; } $ perms = array ( 'owner' => array ( 'read' => ( bool ) ( $ mode & 0x0100 ) , 'write' => ( bool ) ( $ mode & 0x0080 ) , 'execute' => ( bool ) ( $ mode & 0x0040 ) ) , 'group' => array ( 'read' => ( bool ) ( $ mode & 0x0020 ) , 'write' => ( bool ) ( $ mode & 0x0010 ) , 'execute' => ( bool ) ( $ mode & 0x0008 ) ) , 'world' => array ( 'read' => ( bool ) ( $ mode & 0x0004 ) , 'write' => ( bool ) ( $ mode & 0x0002 ) , 'execute' => ( bool ) ( $ mode & 0x0001 ) ) ) ; $ perms [ 'mode' ] = self :: compileMode ( $ perms ) ; return $ perms ; }
Return the permissions set on the specified file.
@param string $path The path to examine
@return array An associative array containing 'owner', 'group' and 'world',
members, each containing 'read', 'write' and 'execute'
indicating their permissions.
Return the permissions set on the specified file .