diff --git a/inc/indexer.php b/inc/indexer.php
index fa3803665091ed9f403caf270dcfe3023cd3f3f6..789a98d91fe2b6820a2e70e2e9513674515bc405 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -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;
 }
 
diff --git a/inc/init.php b/inc/init.php
index ab986b0d2b79a85551da2c70cc8b7bf018b59a6a..00d6a6a9055337444b2bf77b667386d5b2a68feb 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -313,7 +313,7 @@ function scriptify($file) {
   }
   fclose($fh);
   //try to rename the old file
-  @rename($file,"$file.old");
+  io_rename($file,"$file.old");
 }
 
 /**
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index 0b93b882d3c07b95f54d72f3e0f02f90fa1c4216..e51f658145f9c519494e1c1f21e393c56998562b 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -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;
       }