title: Rename file in CodeIgniter
body: <p>I have a file <code>1353683037.jpg</code> in the tmp folder as shown below: </p>
  
  <pre><code>C:\xampp\htdocs\ci_project\public\images\tmp\1353683037.jpg
  </code></pre>
  
  <p>I need to rename this file to: </p>
  
  <pre><code>C:\xampp\htdocs\ci_project\public\images\main\1353683037.jpg
  </code></pre>
  
  <p>To do this, I have done the following: </p>
  
  <pre><code>$file = '1353683037.jpg';
  $dir = './public/images/';
  rename($dir.'tmp\'. $file, $dir.'main\'. $file);
  </code></pre>
  
  <p>I'm having the follwing reply from the server: </p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Warning
  
  Message: rename(./public/images/tmp/1353683037.jpg,../public/images/main/1353683037.jpg) [function.rename]: The system cannot find the path specified. (code: 3)
  
  Filename: controllers/test.php
  
  Line Number: 1
  </code></pre>
  
  <p>What could possibly be the problem? Thanks</p>