Skip to content
Snippets Groups Projects
Commit 9684e36c authored by Andreas Gohr's avatar Andreas Gohr
Browse files

try faster rename before falling back to copy in indexer

darcs-hash:20050907210643-7ad00-a5cd36dc8b48ca445af87e9f066c7a54a98a3658.gz
parent d7c3763d
No related branches found
No related tags found
No related merge requests found
......@@ -148,12 +148,16 @@ function idx_addPage($page){
// close the temp file and move it over to be the new one
fclose($tmp);
if(copy($conf['cachedir'].'/index.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;
}
else{return false;}
return false;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment