protected static function _chmod($filename, $perm, $add) { return chmod($filename, (fileperms($filename) | intval('0' . $perm . $perm . $perm, 8)) ^ $add); }