Project

General

Profile

Bug #14154 » bug_76.diff

Administrator Admin, 2005-10-20 14:19

View differences:

typo3_src-3.8.0/t3lib/class.t3lib_div.php 2005-10-20 14:16:50.000000000 +0200
* @return boolean True if the file was successfully opened and written to.
*/
function writeFile($file,$content) {
if($fd = fopen($file,'wb')) {
if (@is_file($file)) {
// If file already exists before writing, get the permissions of it
$perms = octdec(substr(sprintf('%o',fileperms($file)),2));
} else {
$perms = octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask']);
}
if ($fd = fopen($file,'wb')) {
fwrite( $fd, $content);
fclose( $fd );
t3lib_div::fixPermissions($file); // Change the permissions of the file
@chmod($file, $perms); // Try to change the permissions of the file
return true;
}
}
......
/**
* Setting file system mode & group ownership of file
*
* @param string Filepath of newly created file
* @param string Path to file
* @return void
*/
function fixPermissions($file) {
(2-2/2)