[prev in list] [next in list] [prev in thread] [next in thread] 

List:       novalug
Subject:    [ma-linux] tar file name too long
From:       Paul Tremblay <phthenry () earthlink ! net>
Date:       2003-07-09 20:53:03
[Download RAW message or body]

I have just written a script that uses tar to backup a HD. Everything
seems to work fine, except that really long file names get chopped
off.

I should add that I am using this script on both my linux system and
my girlfriend's Mac OS X system. In order for tar to work on Mac OS X,
you have to use a special form of tar called hfstar, which preserves
those blasted Macintosh resource forks.

The files that get chopped off are iTunes files (a file produced by
Macintosh software called iTunes). These files have long path names,
but they don't necessarily have  long file names:

/Users/cynthia/iTunes/iTunes\ Music/Compilations\ 20th\
Century/ABC/Shoot\ That\ Poision\ Arrow\ Through\ My\ Heart.mpg

(Note: this isn't the exact path; it is pretty close, to give you a good
idea of what I mean.)

The script makes a tar file with no problem. Then, I look at the list
of fils in my tar archive. I notice that the above file gets shortened
to:

/Users/cynthia/iTunes/iTunes\ Music/Compilations\ 20th\
Century/ABC/Sh

If I extract the file from the tar archive, all the data is still
there.

I did a test, and created a file nested inside a zillion other
directories. The path name was much longer than my example above. 

/Users/paul/temp_123456789_123456798_/temp_123456789_123456798/temp_123456789_12345679 \
8_/temp_123456789_123456798/temp_123456789_123456798_/temp_123456789_123456798/temp_123456789_123456798_/temp_123456789_123456798/more\
 more\ more\ more

I tarred the file, and then did:

tar -tf test.tar

Interestingly, the name did *not* get cut off. 

Anyone have a guess as to why tar chops off file names in some
cases but not in others? The only difference between the iTunes path,
and the test path, is that the direcotories in the test path contained
no spaces, thought the file itself did contain spaces.

thanks

Paul



-- 

************************
*Paul Tremblay         *
*phthenry@earthlink.net*
************************
_______________________________________________
ma-linux mailing list
ma-linux@tux.org
http://www.tux.org/mailman/listinfo/ma-linux


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic