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
This commit is contained in:
ksherlock 2009-04-28 03:49:16 +00:00
parent d9f6b903a8
commit 465a813cca
1 changed files with 41 additions and 0 deletions

View File

@ -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';