Magic Number and the file system mystery - Who is the original CAFEBABE ?

File Types and Magic Numbers

Most operating systems has a way of recognizing file types. An operating system needs to recognize a file type so that it will know what to do with it. Since all files are just bits and bytes in the disk it will need to know how to interpret does bits and bytes in a manner consistent to what type of file it is.

One of the most common ways to designate a type to a file is through using file extensions. The part of the file name after the dot (.) . Like .exe, .doc, .java, .jpg An operating system will be able to recognize a file using this extension. This is most commonly used in Windows.

In Unix it is a little bit more flexible. Unix defers how an application can recognize files it can act on. One method is using Magic Numbers (What are magic Numbers ?). But not all files have magic numbers. Unix also allows file extensions - but this is not enforced or dictated by Unix (not like windows) like
.sh .c .gcc .o [1] 



So, Now what is CAFEBABE ?

CAFEBABE is the hexadecimal value of the magic number used on compiled class files for java.(Java Class File).  
So i tried looking into some of the class files in unix and there it is CAFEBABE


But was there really a CAFE BABE ?
If there is, who could she be ?
If you are curious too I think here is a good starting point
Let's Dig this Up!


[1] A. Silberschatz et al, “File Concept,” in Operating System Concepts, 9th ed. Hoboken NJ,USA: Wiley 2013, ch. 11, pp. 510–511.

Comments

Popular posts from this blog

OAuth 1.0a Request Signing and Verification - HMAC-SHA1 - HMAC-SHA256

Spark DataFrame - Array[ByteBuffer] - IllegalAurmentException

Gensim Doc2Vec on Spark - a quest to get the right Vector