Since I’m working with Mac OS X Leopard as my desktop OS, I’ve installed netatalk on my Debian Lenny server using this guide by Stefan LH. While compiling, I got some GPG errors; but they were fixed thanks to the comment of didier.
It rocks, since AFP is much faster from Linux to OS X than Samba. So, I was happy.
But, after a few days I found some weird files, starting with “:2e”. These were files that had names starting with a dot, such as temporary / hidden files. Kind of annoying, especially on the Windows workstation of the rest of the family where all those file names are shown by Windows. It’s just plain ugly.
I’ve been searching around a bit for a solution for this little problem, and I found this post by Simon Wheatly. He’s having even more trouble with those renamed files, as he is using .htaccess files for his webserver.
The reason that afpd renames these files is described in the netatalk manual:
With OS X Apple introduced the AFP3 protocol. One of the most important changes was that AFP3 uses unicode names encoded as UTF-8 decomposed. Previous AFP/OS versions used codepages, like MacRoman, MacCentralEurope, etc.
afpd needs a way to preserve extended macintosh characters, or characters illegal in unix filenames, when saving files on a unix filesystem. Earlier versions used the the so called CAP encoding. An extended character (>0x7F) would be converted to a : xx sequence, e.g. the Apple Logo (MacRoman: 0XF0) was saved as :f0. Some special characters will be converted as to : xx notation as well. ‘/’ will be encoded to :2f, if -usedots is not specified, a leading dot ‘.’ will be encoded as :2e.
This version now uses UTF-8 as the default encoding for names. Special characters, like ‘/’ and a leading ‘.’ will still be CAP style encoded .
The -volcharset option will allow you to select another volume encoding. E.g. for western users another useful setting could be -volcharset ISO-8859-15. apfd will accept any iconv(1) provided charset. If a character cannot be converted from the mac codepage to the selected volcharset, afpd will save it as a CAP encoded character. For AFP3 clients, afpd will convert the UTF-8 character to -maccharset first. If this conversion fails, you’ll receive a -50 error on the mac.
Note: Whenever you can, please stick with the default UTF-8 volume format.
And the fix is fairly simple, just edit your /etc/netatalk/AppleVolumes.default and add the option usedots to your share(s):
~/ “Home Directory” options:usedots
/storage ”Storage” options:usedots
The option “usedots” is alse described in /etc/netatalk/AppleVolumes.default:
don’t do :hex translation for dot files. note: when this option gets set, certain file names become illegal. these are .Parent and anything that starts with .Apple.
So keep an eye on those illegal file names. Generally, this shouldn’t be a problem I think.
Problem fixed
!