Control of File Types in Ubuntu
Apr 15, 2010, 15:34 (0 Talkback[s])
(Other stories by Delan Azabani)
Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers
[ Thanks to Ramsai
for this link. ]
"Ubuntu uses advanced systems for detecting file types
and associating them with applications, but it's not that hard to
dive in and take some control over the formats. In this article by
Delan Azabani, you'll learn how Ubuntu identifies file types, how
to use Assogiate to control these processes, using Ubuntu Tweak to
associate types with applications and use Bless to inspect binary
files. What is a file type?
"Let's not go as far deep as "What is a file?", but before we
start, let's take a look at file types. File types are determined
by the contents of the files themselves, and are used to allow the
opening program to be chosen wisely. In Microsoft Windows, file
extension globbing is the sole method of identifying file types.
Users must provide a common phrase at the end of files, and the
files would be searched by their name, in turn providing the
correct icon and program.
"Things are a little different in Ubuntu. Of course, globbing
(the most basic method) is present for file types, but Ubuntu has a
few other tricks up its sleeve. One of these is magic numbers. The
magic number of a binary file is the first few bytes, which
identify the file type. The definition of a "magic" number has
somewhat loosened in recent years; it can now mean any piece of
data, generally near the beginning of a file, that can be used to
uniquely identify the type."