From 465a813cca392dc454f15ac31909bd99a8f4e755 Mon Sep 17 00:00:00 2001 From: ksherlock Date: Tue, 28 Apr 2009 03:49:16 +0000 Subject: [PATCH] create finder info/HFS creator/type data for all files. git-svn-id: https://profuse.googlecode.com/svn/trunk@37 aa027e90-d47c-11dd-86d7-074df07e0730 --- profuse_xattr.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/profuse_xattr.cpp b/profuse_xattr.cpp index fe0c1e5..cbb2894 100644 --- a/profuse_xattr.cpp +++ b/profuse_xattr.cpp @@ -138,10 +138,51 @@ static void xattr_rfork(FileEntry& e, fuse_req_t req, size_t size, off_t off) static void set_creator(uint8_t *finfo, unsigned ftype, unsigned auxtype) { + + /* + + tech note PT515 + ProDOS -> Macintosh conversion + + ProDOS Macintosh + Filetype Auxtype Creator Filetype + $00 $0000 'pdos' 'BINA' + $B0 (SRC) (any) 'pdos' 'TEXT' + $04 (TXT) $0000 'pdos' 'TEXT' + $FF (SYS) (any) 'pdos' 'PSYS' + $B3 (S16) (any) 'pdos' 'PS16' + $uv $wxyz 'pdos' 'p' $uv $wx $yz + + */ + // the above predates extended auxtypes for $b3. + finfo[0] = 'p'; finfo[1] = ftype; finfo[2] = auxtype >> 8; finfo[3] = auxtype; + + + switch (ftype) + { + + case 0x00: + if (auxtype == 0) memcpy(finfo, "BINA", 4); + break; + case 0x04: + if (auxtype == 0) memcpy(finfo, "TEXT", 4); + break; + case 0xb0: + memcpy(finfo, "TEXT", 4); + break; + case 0xb3: + if (auxtype == 0) memcpy(finfo, "PS16", 4); + break; + case 0xff: + memcpy(finfo, "PSYS", 4); + break; + } + + finfo[4] = 'p'; finfo[5] = 'd'; finfo[6] = 'o';