/**
* Checks if a path's permissions can be changed.
*
* @param string $path Path to check.
*
* @return boolean True if path can have mode changed.
*
* @since 1.7.0
*/
public static function canChmod($path)
{
$perms = fileperms($path);
if ($perms !== false) {
if (@chmod($path, $perms ^ 01)) {
@chmod($path, $perms);
return true;
}
}
return false;
}