If the setting for visibility in FIFlags and AFPAttributes don't match for a file, the result is a "dancing icon".
Steps to reproduce:
touch file from clientSetFile -a V file [1] to set the invisibe flagUntil now everything is fine, both are in sync. But the problem then arises when the AFP client manages to get them out of sync.
SetFile -a l file to disable the lock flag (which wasn't set) and now we have:Voila, out of sync. The SetFile command somehow got them out of sync. If it's a bug in SetFile ot in the AFP client doesn't matter because in the end it's our problem that we store the same flag, which just happens to be queried and set in two different structures, in two places.
To fix this we have to implement the proper syncing for reading and writing of this flags, which will be finicky. Afaict the only other flags stored in both places is "m", the shared flag:
/*
** best read monospaced **
SetFile Option FinderInfo AFP Attributes
============== ========== ==============
A Alias file FinderInfo.FFlags:0x8000
B Bundle FinderInfo.FFlags:0x2000
C Custom icon FinderInfo.FFlags:0x0400
D Desktop FinderInfo.FFlags:0x0001
E Hidden extension FinderInfo.FFlags:0x0010
I Inited FinderInfo.FFlags:0x0100
M Shared (can run multiple times) FinderInfo.FFlags:0x0040 Attributes:0x0002
N No INIT resources FinderInfo.FFlags:0x0080
L Locked Attributes:0x01a0
S System (name locked) FinderInfo.FFlags:0x1000
T Stationery FinderInfo.FFlags:0x0800
V Invisible FinderInfo.FFlags:0x4000 Attributes:0x0001
Z Busy FxInfo.Fxflags: 0x0080
*/
[1]
SetFile and GetFileInfo from Apples DevTools
Gnagh. sf.net doesn't like indentation. Check it out here if you like:
http://docs.google.com/View?id=dgpmfmw6_1cgtxxfrg
This might also similarily effect our invisible dots option, because at least in get_finderinfo()/file.c we only adjust the FinderFlags and not the attributes if the name starts with a period.
I'll have to check this out too while I'm at it.
In testing it worked as expected.
Fixed in HEAD:
http://netatalk.cvs.sourceforge.net/viewvc/netatalk/netatalk/libatalk/adouble/ad_attr.c?r1=1.7&r2=1.8
Attributes invisible and shared are now opaque using corresponding FinderInfo flags.
The final solution is more involved, but basically all that's been said still applies.