original_string: public static function fixPermissions($path, $recursive = FALSE) {
  		if (TYPO3_OS != 'WIN') {
  			$result = FALSE;
  
  				// Make path absolute
  			if (!self::isAbsPath($path)) {
  				$path = self::getFileAbsFileName($path, FALSE);
  			}
  
  			if (self::isAllowedAbsPath($path)) {
  				if (@is_file($path)) {
  						// "@" is there because file is not necessarily OWNED by the user
  					$result = @chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask']));
  				} elseif (@is_dir($path)) {
  						// "@" is there because file is not necessarily OWNED by the user
  					$result = @chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']));
  				}
  
  					// Set createGroup if not empty
  				if ($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) {
  						// "@" is there because file is not necessarily OWNED by the user
  					$changeGroupResult = @chgrp($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']);
  					$result = $changeGroupResult ? $result : FALSE;
  				}
  
  					// Call recursive if recursive flag if set and $path is directory
  				if ($recursive && @is_dir($path)) {
  					$handle = opendir($path);
  					while (($file = readdir($handle)) !== FALSE) {
  						$recursionResult = NULL;
  						if ($file !== '.' && $file !== '..') {
  							if (@is_file($path . '/' . $file)) {
  								$recursionResult = self::fixPermissions($path . '/' . $file);
  							} elseif (@is_dir($path . '/' . $file)) {
  								$recursionResult = self::fixPermissions($path . '/' . $file, TRUE);
  							}
  							if (isset($recursionResult) && !$recursionResult) {
  								$result = FALSE;
  							}
  						}
  					}
  					closedir($handle);
  				}
  			}
  		} else {
  			$result = TRUE;
  		}
  		return $result;
  	}
code: public static function fixPermissions($path, $recursive = FALSE) {
  		if (TYPO3_OS != 'WIN') {
  			$result = FALSE;
  
  				// Make path absolute
  			if (!self::isAbsPath($path)) {
  				$path = self::getFileAbsFileName($path, FALSE);
  			}
  
  			if (self::isAllowedAbsPath($path)) {
  				if (@is_file($path)) {
  						// "@" is there because file is not necessarily OWNED by the user
  					$result = @chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask']));
  				} elseif (@is_dir($path)) {
  						// "@" is there because file is not necessarily OWNED by the user
  					$result = @chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']));
  				}
  
  					// Set createGroup if not empty
  				if ($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) {
  						// "@" is there because file is not necessarily OWNED by the user
  					$changeGroupResult = @chgrp($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']);
  					$result = $changeGroupResult ? $result : FALSE;
  				}
  
  					// Call recursive if recursive flag if set and $path is directory
  				if ($recursive && @is_dir($path)) {
  					$handle = opendir($path);
  					while (($file = readdir($handle)) !== FALSE) {
  						$recursionResult = NULL;
  						if ($file !== '.' && $file !== '..') {
  							if (@is_file($path . '/' . $file)) {
  								$recursionResult = self::fixPermissions($path . '/' . $file);
  							} elseif (@is_dir($path . '/' . $file)) {
  								$recursionResult = self::fixPermissions($path . '/' . $file, TRUE);
  							}
  							if (isset($recursionResult) && !$recursionResult) {
  								$result = FALSE;
  							}
  						}
  					}
  					closedir($handle);
  				}
  			}
  		} else {
  			$result = TRUE;
  		}
  		return $result;
  	}
code_tokens: public static function fixPermissions ( $ path , $ recursive = FALSE ) { if ( TYPO3_OS != 'WIN' ) { $ result = FALSE ; // Make path absolute if ( ! self :: isAbsPath ( $ path ) ) { $ path = self :: getFileAbsFileName ( $ path , FALSE ) ; } if ( self :: isAllowedAbsPath ( $ path ) ) { if ( @ is_file ( $ path ) ) { // "@" is there because file is not necessarily OWNED by the user $ result = @ chmod ( $ path , octdec ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'BE' ] [ 'fileCreateMask' ] ) ) ; } elseif ( @ is_dir ( $ path ) ) { // "@" is there because file is not necessarily OWNED by the user $ result = @ chmod ( $ path , octdec ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'BE' ] [ 'folderCreateMask' ] ) ) ; } // Set createGroup if not empty if ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'BE' ] [ 'createGroup' ] ) { // "@" is there because file is not necessarily OWNED by the user $ changeGroupResult = @ chgrp ( $ path , $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'BE' ] [ 'createGroup' ] ) ; $ result = $ changeGroupResult ? $ result : FALSE ; } // Call recursive if recursive flag if set and $path is directory if ( $ recursive && @ is_dir ( $ path ) ) { $ handle = opendir ( $ path ) ; while ( ( $ file = readdir ( $ handle ) ) !== FALSE ) { $ recursionResult = NULL ; if ( $ file !== '.' && $ file !== '..' ) { if ( @ is_file ( $ path . '/' . $ file ) ) { $ recursionResult = self :: fixPermissions ( $ path . '/' . $ file ) ; } elseif ( @ is_dir ( $ path . '/' . $ file ) ) { $ recursionResult = self :: fixPermissions ( $ path . '/' . $ file , TRUE ) ; } if ( isset ( $ recursionResult ) && ! $ recursionResult ) { $ result = FALSE ; } } } closedir ( $ handle ) ; } } } else { $ result = TRUE ; } return $ result ; }
docstring: Sets the file system mode and group ownership of a file or a folder.
  
  @param string $path Path of file or folder, must not be escaped. Path can be absolute or relative
  @param boolean $recursive If set, also fixes permissions of files and folders in the folder (if $path is a folder)
  @return mixed TRUE on success, FALSE on error, always TRUE on Windows OS
docstring_tokens: Sets the file system mode and group ownership of a file or a folder .