Wednesday 21 July 2010

dot underscore files in mac tar files

I have found a nasty issue taring files in a mac osX 10.5. When you tar the files sometimes tar creates a '._'  file for each of your files that stores all the metadata (similar to the .files when you copy to a non mac file system)

http://arstechnica.com/apple/reviews/2005/04/macosx-10-4.ars/7

Solution:

add to your bash

[for Tiger]
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true


[for Leopard]
(from http://aaronlongwell.com/2008/05/removing---dot-underscore-file.html)
export COPYFILE_DISABLE=true

Just in case you forgot to skip them, you can prevent the creation at extraction time with:
tar -xzpvf mytarfile.tgz --exclude="._*"

3 comments:

Dave said...

Thanks much for this post. The ._ files were bugging the heck out of me!

Anonymous said...

Thank you!! Was having this problem on the iphone with in-app purchase from our server. Was really confusing.

Alberson said...

A comment per year, but HELL YES, thank you.