title: After tar extract, Changing Permissions
body: <p>Just a Question Regarding unix and PHP today.</p>
  
  <p>What I am doing on my PHP is using the Unix system to untar a tarred file.</p>
  
  <p><code>exec("tar -xzf foo.tar.gz");</code></p>
  
  <p>Generally everything works fine until I run into this particular foo.tar.gz, which has a file system as follows:</p>
  
  <pre><code>Applications/
  Library/
  Systems/
  </code></pre>
  
  <p>After running the tar command, it seems that the file permissions get changed to 644 (instead of 755). </p>
  
  <p>This causes <code>Permission denied (errno 13)</code> and therefore disabling most of my code. (I'm guessing from lack of privileges) </p>
  
  <p>Any way I can stop this tar command completely ruining my permissions?</p>
  
  <p>Thanks.         </p>
  
  <p>Oh and this seems to only happen when I have a foo.tar.gz file that Has this particular file system. Anything else and I'm good.</p>