PaxHeaders in tarball
<p>I'm doing a <code>tar</code> like in C, and I've got a problem.
I just want to archive and unarchive files and diretories, so I operate this command: <code>tar -cvf NAME.tar FILE1 [FILE2...]</code></p>
<p>Now I'm trying to get the header <code>POSIX</code> of this archive :</p>
<pre><code>struct posix_header
{                              /* byte offset */
  char name[100];               /*   0 */
  char mode[8];                 /* 100 */
  char uid[8];                  /* 108 */
  char gid[8];                  /* 116 */
  char size[12];                /* 124 */
  char mtime[12];               /* 136 */
  char chksum[8];               /* 148 */
  char typeflag;                /* 156 */
  char linkname[100];           /* 157 */
  char magic[6];                /* 257 */
  char version[2];              /* 263 */
  char uname[32];               /* 265 */
  char gname[32];               /* 297 */
  char devmajor[8];             /* 329 */
  char devminor[8];             /* 337 */
  char prefix[155];             /* 345 */
                                /* 500 */
};
int main()
{
    struct posix_header header;
    int fd;

    if ((fd = open(&quot;./obj.tar&quot;, O_RDONLY)) &lt; 2)     //open tarball
        return (1);
    read(fd, &amp;header, 500);                         //fill struct
    printf(&quot;%s\n&quot;, header.name);
    close(fd);
}
</code></pre>
<p>but the output is always as <code>./PaxHeaders.NUMBER/FILE_NAME</code>.
When I try to open the archive in an editor, it shows a PaxHeader before each file.</p>
<p>What is <code>PaxHeaders</code>? Is there a header added to be fully compatible with Pax? If there is, is it possible to remove them?</p>
<p>I'm a bit lost, do I have to parse them or jump after these headers?</p>