for the benefit of email clients, add a few character sets and change the mime type of a directory to "text/directory". Notes: Wed Dec 14 17:26:02 EST 2011 geoff The first change is a bad idea (directories aren't text), and the second is redundant: the tables are already in file. Reference: /n/sources/patch/sorry/fileemail Date: Wed Dec 7 16:35:50 CET 2011 Signed-off-by: quanstro@quanstro.net Reviewed-by: geoff --- /sys/src/cmd/file.c Wed Dec 7 16:35:47 2011 +++ /sys/src/cmd/file.c Wed Dec 7 16:35:46 2011 @@ -335,7 +335,7 @@ return; } if(mbuf->mode & DMDIR) { - print(mime ? OCTET : "directory\n"); + print(mime ? "text/directory\n" : "directory\n"); return; } if(mbuf->type != 'M' && mbuf->type != '|') { @@ -606,6 +606,10 @@ 0xfeedfacf, 0xFFFFFFFF, "amd64 Mach-O executable\n", OCTET, /* 0xcafebabe */ 0xbebafeca, 0xFFFFFFFF, "Mach-O universal executable\n", OCTET, + 0xfeff0000, 0xffffffff, "utf-32be\n", "text/plain; charset=utf-32be", + 0xfffe, 0xffffffff, "utf-32le\n", "text/plain; charset=utf-32le", + 0xfeff, 0xffff, "utf-16be\n", "text/plain; charset=utf-16be", + 0xfffe, 0xffff, "utf-16le\n", "text/plain; charset=utf-16le", /* * venti & fossil magic numbers are stored big-endian on disk, * thus the numbers appear reversed in this table.