Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 +SENDMAIL+2.11; site dcl-cs.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!talcott!harvard!seismo!mcvax!ukc!icdoc!dcl-cs!de From: de@dcl-cs.UUCP (David England) Newsgroups: net.unix Subject: Testing to see if a file is ASCII Message-ID: <503@dcl-cs.UUCP> Date: Tue, 10-Sep-85 11:14:39 EDT Article-I.D.: dcl-cs.503 Posted: Tue Sep 10 11:14:39 1985 Date-Received: Sat, 14-Sep-85 06:00:53 EDT Reply-To: de@dcl-cs.UUCP (David England) Organization: Department of Computing at Lancaster University. Lines: 29 Xpath: icdoc ivax In the following piece of program to test for an ASCII file I know that the commented values are magic numbers from a.out format files but I'm curious to know what the other values represent ? /* c is the first character in the file with descriptor f */ /* runs on UNIX 4.2 Vax or Sun */ switch ((c | *f->_ptr << 8) & 0177777) { case 0405: case 0407: /*magic number*/ case 0410: /*magic number*/ case 0411: case 0413: /*magic number*/ case 0177545: printf("SomeErrorMessage"); default: break; } All flames to /dev/blackhole. "I vomit when I see icons!" -- UUCP : ..!seismo!mcvax!ukc!dcl-cs!de DARPA : de%lancs.comp@ucl-cs JANET : de@uk.ac.lancs.comp PHONE : +44 524 65201 Ext. 4586 POST : Univ. of Lancaster, Dept of Computing, Lancaster LA1 2YR, UK. PROJECT : Alvey ECLIPSE User Interface