changed all occurances of rename() to io_rename()
darcs-hash:20060507101333-7ad00-e687d797fbee26e0b0bc7741ff8a1af496c101bf.gz
This commit is contained in:
parent
15c394af37
commit
3aee4c2781
|
@ -164,14 +164,8 @@ function idx_addPage($page){
|
|||
// close the temp file and move it over to be the new one
|
||||
fclose($tmp);
|
||||
// try rename first (fast) fallback to copy (slow)
|
||||
if(@rename($conf['cachedir'].'/index.tmp',
|
||||
$conf['cachedir'].'/index.idx')){
|
||||
return true;
|
||||
}elseif(copy($conf['cachedir'].'/index.tmp',
|
||||
$conf['cachedir'].'/index.idx')){
|
||||
unlink($conf['cachedir'].'/index.tmp');
|
||||
return true;
|
||||
}
|
||||
io_rename($conf['cachedir'].'/index.tmp',
|
||||
$conf['cachedir'].'/index.idx');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ function scriptify($file) {
|
|||
}
|
||||
fclose($fh);
|
||||
//try to rename the old file
|
||||
@rename($file,"$file.old");
|
||||
io_rename($file,"$file.old");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -89,11 +89,11 @@ if (!class_exists('configuration')) {
|
|||
// backup current file (remove any existing backup)
|
||||
if (@file_exists($file) && $backup) {
|
||||
if (@file_exists($file.'.bak')) @unlink($file.'.bak');
|
||||
if (!@rename($file, $file.'.bak')) return false;
|
||||
if (!io_rename($file, $file.'.bak')) return false;
|
||||
}
|
||||
|
||||
if (!$fh = @fopen($file, 'wb')) {
|
||||
@rename($file.'.bak', $file); // problem opening, restore the backup
|
||||
io_rename($file.'.bak', $file); // problem opening, restore the backup
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue