> On Tue, 22 Aug 1995 08:55:48 +0200, Frode Tenneboe said: > > Then you also might define the first 512 characters of a text file as a > > magic number too. > > :-) > > > And "#!" doesn't > > uniqely distinguish a file - on the other hand a line starting with > > "#!" does. > > I don't know what you mean. If the file starts with "#!" then that > certainly does give a very strong hint as to what the file is. In the
You only know that it's some sort of script-file, not for which script-language. > same manner, if the file starts with "%!" then you know it's probably a > PostScript document (and that _is_ in /etc/magic). The key-word here is 'probably' - nothing magic about that. :) > > If it's at the start of the file and if any utility other than "file" > looks at it to find out what the file is then it's a magic number as > far as I'm concerned. > The UNIX 'magic number' does not necessarily have to be at the start of a file. But of course, a magic number posibility is perfectly ok as long as I can forget about it without violating system integrity and causing 'core dump'. ;) > imc > -Frode

