Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 4 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
1  
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 Aug 1 '12 at 0:08
add comment

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 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.