From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <011A09A5-865D-408B-831D-255ED03BBAF6@corpus-callosum.com> From: Jeff Sickel To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Date: Sun, 6 Jul 2008 13:16:52 -0500 Subject: [9fans] a question of file and the history of magic Topicbox-Message-UUID: dc25ced0-ead3-11e9-9d60-3106f5b1d025 This is a comment/question about file(1) as implemented in Plan 9 and p9p. Over the years I've been using various versions of file with editable magic files. Though file "can make mistakes", this worked out rather well when I just wanted a little more detail than 'binary' with the tradeoff of the command being a bit slow at times. While deciding to use p9p's rc for a script to help with some picture process, I realized I needed to use file to help determine the type of data I'm checking on the file system. So I added the following (though it could just be added to the long0tab just as easily): % hg diff file.c diff -r d7799c860a8f src/cmd/file.c --- a/src/cmd/file.c Sat Jul 05 10:01:43 2008 -0400 +++ b/src/cmd/file.c Sun Jul 06 12:30:28 2008 -0500 @@ -655,6 +655,7 @@ "\377\330\377\340", "jpeg", 4, "image/jpeg", "\377\330\377\341", "jpeg", 4, "image/jpeg", "\377\330\377\333", "jpeg", 4, "image/jpeg", + "\106\117\126\142", "x3f", 4, "image/x3f", "BM", "bmp", 2, "image/bmp", "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1", "microsoft office document", 8, "application/octet-stream", "