Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On a Solaris when creating a tar archive using the cf options:

tar cf file.tar dir

and when many nested directories generates very long path names, I get the error:

tar: filename: filename is greater than 100

How to avoid it?

Here is the details of the machine:

# uname -a
SunOS <box-name> 5.10 Generic_125100-10 sun4v sparc SUNW,Sun-Fire-T200
share|improve this question
up vote 5 down vote accepted

I used the option E

Write a tarfile with extended headers

So the command tar cEf file.tar dir worked smoothly

share|improve this answer
Using the -E option worked for me on Solaris, but it may not work properly if you want to extract the archive on another platform, which may not understand the header format as a result of the -E option. For example, I was extracting the archive on Unbutu, and it could not properly decode certain filenames, such as ones containing the character é when the -E option was used on Solaris. These filenames extracted fine on Ubuntu when I didn't use the -E option on Solaris. I ended up using gtar on Solaris. – Nathan Jul 31 '12 at 18:53
gtar is great, if you can have it! When I posted this question I was working on Solaris boxes with no permission to install or compile gtar... – Filippo Vitale Aug 1 '12 at 0:08

That's a restriction of pre-POSIX tar. You can use cpio -H ustar, POSIX standard pax, or install GNU tar.

share|improve this answer
+1 for GNU tar. It also has extensions for handling compression. – Rich Homolka May 31 '11 at 19:10
Thank @geekosaur for the solutions proposed: (unfortunately) I can't install GNU tar but the cpio should work very well! Thanks – Filippo Vitale May 31 '11 at 23:47
+1 GNU tar was available to me on Solaris SmartOS as gtar. – Nathan Jul 31 '12 at 19:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .