title: Codeigniter cannot unlink file created by codeigniter
body: <p>I hope someone can help me with this.
  I am creating a text file from the query results from a mysql DB. I then set the file to auto download. Once that is done I am trying to unlink the file. It fails to remove the file from the server. When I go to the location and manually try to delete the file it states that it is write protected.</p>
  
  <p>I do not have root access to this system so I can not change the permissions on said file.</p>
  
  <p>Here is the code, is there a way to not create a write protected file?</p>
  
  <pre><code>$leagueinfo = $this-&gt;livedraft_win_model-&gt;get_leagueinfo($sport, $leagueid);
  $export = $this-&gt;my_model-&gt;get_export($sport, $leagueid);
  $file_name = $leagueinfo['strat_id'] . '.IOD';
  $export=strip_quotes($export);
  $export = str_replace(", ",",",$export);
  write_file('/tmp/' . $file_name, $export,'x+');
  $data = file_get_contents('/tmp/' . $file_name, FILE_BINARY);
  ob_clean();
  force_download($file_name, $data);
  array_map('unlink', glob("/tmp/*.IOD"));
  </code></pre>
  
  <p>I use the same unlink format to remove files that are uploaded to the same location and that works just fine. It is only when I try to remove the files that are created by codeigniter.
  Thanks</p>