Blog An exploration of the art and
craft of software development

dot underscore file trouble

Posted by Marty Haught on Saturday, September 06, 2008

On my new project I have encountered a curious program with ._* files on Leopard. This project deals with customizing Zimbra for a client and more specifically in doing heavy modifications to a skin or theme in Zimbra. Skins in Zimbra are actually pretty cool and allow great flexibility in how the Zimbra Web Client is displayed. In a nutshell a skin includes property files, custom html, images and css as well as overriding internal widgets in Zimbra as templates. Usually you’ll tarball all of the skins files in a specific directory structure and expand it on the server. Then the skin goes through a deploy process that includes a compilation step. I started to run into odd errors in this deploy process that threw me for a loop.

For example, here was the error I kept getting:

/opt/zimbra/bin/zmskindeploy: line 93: [: ./templates/share/._Widgets.template: unary operator expected

Now there is a lot that happens behind the scenes with the skin deploy process so I figured that the .Widgets.template was normal. When I couldn’t determine any sane reason that I should be getting an error I started asking questions. It turns out that this bonus file, .Widgets.template, was killing the compile step for the templates and thus not letting the real template get compiled.

So then I check it to see how this file slipped in there. I use TextMate for editing so I was pretty sure it wasn’t some secret editor file that was being generated. Sure enough a quick check of my development directory had no such file. It wasn’t until I checked the tar process that it popped up. Having used tar for many of years I couldn’t recall this happening before so I was stumped. Luckily a bit of googling help find some answers.

It turns out that OSX, Leopard in my case, creates these hidden files when you tar them up. I’m not sure why they are there but it turns out you can suppress them. For leopard you just need to run this command in your shell:


After I did this my tar command behaved normally and no more of those ._ files came along for the ride. To keep this setting around for good, I added it to my .profile.

I’ve never run into this problem before and I’ve been using OSX for almost two years now. Anyway, hopefully this will save someone else some headache especially when you’re dealing with Zimbra skins.

blog comments powered by Disqus