Recent changes to 12: make tar POSIX-capablehttps://sourceforge.net/p/unxutils/feature-requests/12/Recent changes to 12: make tar POSIX-capableenThu, 05 Apr 2007 17:46:27 -0000make tar POSIX-capablehttps://sourceforge.net/p/unxutils/feature-requests/12/<div class="markdown_content"><p>We found that untarring a tar set created on an IRIX system does not place the resulting files in the expected location in some cases. These are cases where the path+file name of the file in the archive is more than 255 characters (excluding NULL).</p>
<p>In our case we were NOT using the -O option.</p>
<p>The IRIX tar man page says:</p>
<p>If the O option is specified the maximum pathlength--including the<br />
filename itself-- is 99 characters (NAMSIZ) not including the string-<br />
terminating NULL character, and any archives created with non-POSIX</p>
<p>standard versions of tar will also obey this length rule. Otherwise,<br />
(the [default] POSIX format), pathnames are limited to 255 total<br />
characters (not including the NULL), subject to several caveats<br />
necessitated by the requirement of total backward compatibility with<br />
previous versions of tar. Referring to /usr/include/tar.h, there are two<br />
storage fields for filenames name, (100 chars) and prefix (156 chars).<br />
If the entire pathname is 100 characters or less including the NULL, it<br />
will be stored in the name field. Otherwise the pathname is split<br />
between the two fields, with the restriction that an implicit (i.e.,<br />
unstored) '/' character separates the prefix and name fields. Upon<br />
extraction, the full pathname is constructed by concatenating these<br />
fields with the added '/'. Because of this requirement, files whose<br />
actual names (not including the leading path) exceed 99 characters cannot<br />
be archived. If the split field is used, and the tape is read on older,<br />
non-POSIX capable tar, the file will be extracted in the current<br />
directory, since no leading pathname information is located in the older<br />
location in the header; this at least allows the file to be extracted on<br />
older systems, but if multiple files with the same final component are<br />
extracted, the earlier will be overwritten by the later file(s).</p>
<p>Example tar file is attached. The last two files <br />
phase_score_hypotheses_run2_small_prj_results/phase_score_hypotheses_run2_small_prj_02366_hypothesis.tab<br />
phase_score_hypotheses_run2_small_prj_results/phase_score_hypotheses_run2_small_prj_02366_scores.out</p>
<p>end up as the following when extracted with unxutils tar:</p>
<p>phase_score_hypotheses_run2_small_prj_02366_hypothesis.tab<br />
phase_score_hypotheses_run2_small_prj_02366_scores.out</p></div>SilversteinThu, 05 Apr 2007 17:46:27 -0000https://sourceforge.netaca1c07086cbacb3ec98464322ac0b38ec0a33a6