On Thu, 2016-02-11 at 10:09 +0000, Pete Biggs wrote:
> > 
> > OK, so I ran the file command, file attachment.dat, and got this
> > message: 'very short file (no magic)'. No 'strange' number or
> > strings or
> > anything! Extremely educational answers from you, even though it's
> > 'far
> > from Evolution'. Or is it. So 'no magic', 'ey? 
> 
> The "magic" refers to the mechanism it uses to work out what the file
> is. Each type of file has a certain pattern of bytes in it that is
> unique - the uniqueness may be by design to help the process (so
> there
> are certain byte sequences at specific points in the file) or it may
> be
> coincidental and found by trial and error.  Whatever way it is, then
> it
> looks like "file" is using magic to work out what the file does -
> hence
> the name.  If there is not enough content in the file to perform the
> magic, then you get that error message.

In fact "magic" is one of those words (like "daemon", "setuid" or
"sticky bit") that dates back to the early days of Unix. Executable
files in the old a.out format had a specific binary value in the first
word (octaL 0407, which was the PDP-11 instruction for "jump 16 bytes
forward", i.e. a jump to where the actual code started). This was
called the "magic number". The concept was extended to more flexible
ways of identifying file types when the "file" command was introduced.

For a fuller discussion, see http://www.catb.org/jargon/html/M/magic-nu
mber.html (in fact the entire Jargon File is worth reading).

poc
_______________________________________________
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list

Reply via email to