rename should overwrite files and dirrectories (http://php.net/manual/en/function.rename.php)