Re: maintaining type/creator


Subject: Re: maintaining type/creator
From: Sak Wathanasin (sw@nan.co.uk)
Date: Tue Sep 05 2000 - 04:59:54 EDT


In reply to Harry Zink/Netatalk List's message of the 04/09/2000 at
18:35 -0700,

>As previously stated, Mac files do not need extensions to show up - they
>will be properly recognized. Contrary to another statement, though, you *DO*
>need the AppleVolumes.system file to be present - it is not just a
>'convenience', as removing it from a functional system reduces all filetypes
>to blank generics.

No, the previous poster was correct: the extensions map in the
AppleVolumes.system is used ONLY for files that are NOT created by a
Mac. The MacOS filesystem maintains type/creator, icon, position,
comments etc itself, completely integrated into the filesystem. Unix
has no direct equivalent of this, so netatalk simulates this by
maintaining a hidden directory .AppleDesktop at the top-level of each
mount point.

If you copy a file to a netatalk volume with the Finder or create it
directly using any Mac application (using, eg, "Save" or "Save
as..."), the necessary icon &c info should be written to the netatalk
volume regardless of the disposition of the AppleVolumes.system file
(I've just renamed my AppleVolumes.system and tried it). If this
isn't happening on your system, it's probably due to some permissions
problem on the .AppleDesktop directory (or one of its
sub-directories) preventing netatalk from writing the reqd info.

At a minimum, the perms need to be 755 on the .AppleDesktop
directory. That's the way it should be created by netatalk if it has
write perm to the top-level directory (the mount point). On a
directory intended to be shared by several users, you will need to
use setgid. For example:
        ls -ld /home/NAL
        drwxrwsr-x 20 NAL NAL 4096 Sep 5 09:00 /home/NAL

This directory can be mounted by any member of group NAL (ie people
in my company); the setgid bit ensures that all files and directories
created under /home/NAL belong to group NAL and so are
readable/writeable by any member of that group. In particular,

        drwxrws--- 53 NAL NAL 4096 Aug 3 01:09 .AppleDesktop

allows icon &c info to be propogated.

The mappings in AppleVolumes.system are needed when the file is
created by something other than a Mac. In this case, the
.AppleDesktop DB would not be updated, and so the Mac would "see" the
file as a generic (blank) icon. So netatalk uses the filename
extension and the map in AppleVolumes.system to fake a creator/type
to the MacOS. This allows one (with suitable mappings) to dbl-click
on a file "xxx.jpg" and have it opened by Photoshop, for example.

One last tip: set the default mapping to DATA, not TEXT:

. DATA ????

This helps to prevent unwanted CR/LF translations - if netatalk
thinks something is a text file, it maps LF <-> CR on-the-fly to make
the file more palatable to Mac appls that are expecting a text file.
You don't want this if the file really is a binary file (a graphics
file for example). Modern Mac text editors can cope with any combo of
CR/LF as a line-ending, so it's not a big issue anymore.

-- 
Sak Wathanasin
Network Analysis Limited
178 Wainbody Ave South, Coventry CV3 6BX, UK

Internet: sw@nan.co.uk Phone: (+44) 24 76 41 99 96 Mobile: (+44) 79 70 75 19 12 Fax: (+44) 24 76 69 06 90



This archive was generated by hypermail 2b28 : Wed Jan 17 2001 - 14:32:06 EST