This post may be useful to anyone using SMB to share files to Windows users, but is particularly important to Leopard Server users because of the way OS X uses hidden files in the file system.
In the office we have a Mac Pro running Leopard Server. This machine acts as (amongst other things) a file server, providing a common area for sharing files (that are backed up as I’ve discussed previously).
OS X users can access the server using AFP or SMB, and Windows users use SMB. I was whinging to a colleague that Windows keeps leaving these files around that we can see when sharing the drive – those files being:
He pointed out that that was nothing compared to the sheer number of files Apple’s AFP and OS X leaves behind:
That’s a whole lot of dot files that OS X users never see because dot files by default are hidden from the user (as they are in any Unix/Linux implementation). However, Windows doesn’t use that convention.
I logged in via Windows and he was right – the file system was a mess. I felt sorry for the Windows users (more than I usually do just because they are Windows users).
So, anyway, to cut a long story short, here’s the fix. On Leopard Server, edit the file
/etc/smb.conf from a Terminal window – something like:
sudo vi /etc/smb.conf
Add the following two lines to the
[global] section of the file, and save the file:
veto files = /.*/Thumbs.db/
delete veto files = yes
From the Server Admin application, restart SMB.
Now, anyone connected via SMB to the shared file system will no longer see the dot files or the
This doesn’t fix the issue with Microsoft Office leaving
~$* files everywhere, or Windows
*.tmp files. You could hide them by adding them to the veto file list, but you probably don’t want to just hide the files as they are quite large. I’m thinking I might write a script that automatically removes these files once they are older than a few days, to try and keep things clean. If you have such a script, then you could hide the other files too.