FW: [Scottish] type of files

Huard, Elise - D C&W Consultant scottish at mailman.lug.org.uk
Wed Aug 28 16:40:01 2002


OK - the magic number it is then.  I'll have to dig a bit to find out how to
get that, but a very loose inspiration from 'file' should do it ... (my
employer doesn't use GPL alas)

Thanks all for the help,

Elise

----------
From:  Peter Michael Kavanagh [SMTP:Peter.Kavanagh@nsc.com]
<mailto:[SMTP:Peter.Kavanagh@nsc.com]> 
Sent:  28 August 2002 16:29
To:  Huard, Elise - D C&W Consultant
Subject:  [Scottish] type of files

Elise,

Once was the day when all binary file standards used a "magic number" system
where the first 4 bytes of a file could be decoded into four ascii
characters.  These coresponded to the commonly used three or four letter
extention (pcx,jpeg,gds2,aud,wav).  If you open up a common binary file in
vi, chances are the first four chars look familiar.
Then along came the 8.3 filenames and people just used the 3 letter
extension.  Most basic unix systems will read both the magic number and any
extension and judge what the file is.  You can do this with a standard
binary read in C.
Hope that helps.
Peter Kavanagh
(Not on the list, but feel free to fwd)
***********************************************************************************
This email and any accompanying files are confidential.      If you are
not  the  intended recipient  you  must not use,  copy or disclose the
content.   If you have received this email in error please contact the 
sender by return email and delete this message. 
Thankyou for your co-operation.
*************************************************************************************