title: Using Copy Directory Helper in Codeigniter to copy and move files
body: <p>I am using this <a href="http://codeigniter.com/wiki/copy_directory/" rel="nofollow">copy directory</a> helper addon for the directory helper to help me copy files to different places on my web server.</p>
  
  <p>It works perfectly if the files you are copying from and the folder you are copying to are located within the CodeIgniter install directory.</p>
  
  <p>I however have my codeigniter installation in a subdirectory (http://domain.com/site) and would like to be able to move and copy directories in the root directory.</p>
  
  <pre><code>directory_copy('./user_guide/', './test_copy/');
  </code></pre>
  
  <p>Creates test_copy and copies the contents of user_guide to it.</p>
  
  <p>However doing this (NOTICE the missing DOT( . ) in the destination directory)</p>
  
  <pre><code>directory_copy('./user_guide/', '/test_copy/');
  </code></pre>
  
  <p>Causes</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Warning
  
  Message: mkdir() [function.mkdir]: Permission denied
  
  Filename: helpers/directory_helper.php
  
  Line Number: 91
  A PHP Error was encountered
  
  Severity: Warning
  
  Message: mkdir() [function.mkdir]: No such file or directory
  
  Filename: helpers/directory_helper.php
  
  Line Number: 91
  A PHP Error was encountered
  
  Severity: Warning
  
  Message: copy(/test_copy/helpers/cookie_helper.html) [function.copy]: failed to open stream: No such file or directory
  
  Filename: helpers/directory_helper.php
  
  Line Number: 99
  A PHP Error was encountered
  
  Severity: Warning
  
  Message: copy(/test_copy/helpers/string_helper.html) [function.copy]: failed to open stream: No such file or directory
  
  Filename: helpers/directory_helper.php
  
  Line Number: 99 
  </code></pre>
  
  <p>...etc for each file in the directory.</p>
  
  <p>I have checked all permissions and they seem fine. It seems the script can’t execute outside of the CI installation.</p>
  
  <p>All help or advice would be appreciated</p>
  
  <p>Thanks,</p>
  
  <p>Tim </p>