[PLUG] Meaning of binary was: Reading HPFS/NTFS drive

Carlos Konstanski ckonstanski at pippiandcarlos.com
Fri Aug 8 19:38:32 UTC 2008


Wayne E. Van Loon Sr. writes:
 > Richard and all:
 > I don't have anything to offer in the way of help, sorry. But I am 
 > curious about something and wonder if someone can help me understand.
 > As I understand it, files that are compiled / assembled are usually 
 > referred to as "binary" (for some reason that makes no sense to me). 
 > Maybe a misnomer that has stuck?
 > 
 > I wonder if Konqueror is unable to interpret files in the file systems 
 > and therefore tags it as a "binary" file. I also wouldn't expect a log 
 > file to be a "binary" - unless binary has other meanings in other contexts.
 > Wayne

Binary files are just plain files.  There is no concept of lines.
Such a concept only has meaning when dealing with text that a human
can read (stories, source code, log files).  Even if a file contains
only ASCII characters, it is not necessarily a text file.  A
BASE64-encoded MIME attachments is ASCII, but it is not
human-readable, and has no end of line markers.  Also consider an
ASCII-encoded GPG key.

Some binary files (files without line demarcations) are used to store
natively executable code, or executable bytecode.  These are
executable binaries.  There are also executable text files, which are
ASCII files, containing human-readable text (and lines!), the contents
of which happen to be parseable and interpretable by some language
engine, like perl or bash.

I will hang it out there and make a guess that binary files are called
that for this reason: the contents are interesting at a bit-wide
level.  It is fun to observe the bit patterns in machine code words,
and doing so will shed much light on why the various codes have the
values they do.  Compression works at the bit level, and the resulting
files need to convey that.  Bitmaps are an obvious, self-explanatory
example.

Many programs (konqueror may or may not be one of these, but I suspect
it is) use MIME mappings to decide what type of data a file contains.
This just means that it uses the filename extension as its one and
only clue.  You can go into such programs and change the MIME mappings
if you want; it's just a dumb hash table.  On the other hand, the
"file" command line program actually looks at the file header.
-- 
Carlos



More information about the PLUG mailing list