Subject: get filetype and creator on Linux box

From: Antje Oldenburg <[email-masked]>
Date: Tue, 05 Feb 2002 12:58:16 +0100

Hello,

My situation is that I have a netatalk volume set up where Mac users put 
files in. I then have to take the files and do different things on 
different types of files. Now I cannot see how to get the Type and 
Creator Information from within a script on the linux box.

Thanks
Antje Oldenburg

---

From: Thomas Kaiser <[email-masked]>
Date: Tue, 05 Feb 2002 13:56:15 +0100

On Tue, 05 Feb 2002 12:58:16 +0100, Antje Oldenburg wrote:

> Now I cannot see how to get the Type and Creator Information from within a
> script on the linux box.

There exists bin/afile in recent netatalk versions for exactly this purpose
(<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/netatalk/netatalk/bin/afile
/>). It should work with older versions of netatalk, too, as the file format
of the .AppleDouble files (where the informations is read from) hasn't
changed.

    tk@/home/tk > /usr/local/bin/afile /home/tk/pdfworld0104.pdf
    PDF  CARO /home/tk/pdfworld0104.pdf

--> filetype "PDF ", creator code "CARO"

Regards,

Thomas