title: Remove trailing null characters produced by tar
body: <p>I'm trying tar up some files and pass them along to the user through the php passthru command.</p>
  
  <p>The problem is that even though the tar file should only be like 2k it is always 10240. Funny number right?</p>
  
  <p>So I have broken it down to:</p>
  
  <pre><code>-sh-4.1# tar czf -  test | wc -c
  10240
  </code></pre>
  
  <p>VS:</p>
  
  <pre><code>-sh-4.1# tar czf test.tar.gz test &amp;&amp; wc -c test.tar.gz
  2052 test.tar.gz
  </code></pre>
  
  <p>So tar is clearly padding out the file with NULL.</p>
  
  <p>So how can I make tar stop doing that. Alternatively, how can I strip the trailing NULLs.</p>
  
  <p>I'm running on <code>tar (GNU tar) 1.15.1</code> and cannot reproduce on my workstation which is <code>tar (GNU tar) 1.23</code>, and since this is an embedded project upgrading is not the answer I'm looking for (yet).</p>
  
  <p>Edit: I am hoping for a workaround that does need to write to the file system.. Maybe a way to stop it from padding or to pipe it through sed or something to strip out the padding.</p>