[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: associating extensions with applications

I am not sure what the "GUI" (e.g. gnome) use to identify applications.

As to file types, the standard from a command window is to use the
"file" utility, as in
   file   someFileName
The file utility uses a traditional file identification system known
as the "magic" system.  This system has been enhanced over the years,
but basically reads a certain number of bytes from the beginning
of a file and then uses a pattern matching technique against a list
of patterns.  The first match then identifies the type of file.

On a machine here, the patterns are in the file /usr/share/file/magic.
It is interesting to browse that file.  Also
   man magic
in a command window gives further information.

Does anyone know whether the desktops (e.g. gnome) are using this
infrastructure (the "magic" system) or have implemented an
independent system for linking applications to files?

Also, I presume that, even if the "magic" system is used to identify
the file type, there must be somewhere in the gnome (or other desktop)
infrastructure that ties an actual application to a file type, e.g.
OpenOffice word processor to word perfect files.  Does anyone know
where that linkage is done?

David Fletcher wrote:

On Wednesday 31 January 2007 15:36, Gerhard Magnus wrote:

Does Linux, or more specifically the Gnome desktop, have a widget like
the one in Windows that associates file extensions with applications so
that, for example, when I double-click on a ".txt" file it opens in my
favorite text editor?  Do file extensions have any significance in
Linux?  Thanks for the help! -- Jerry

Linux is much more clever than that. So far as I know it takes no notice of file name extensions. It looks at the header information inside the file itself.

For instance, today I copied in an old file that was originally prepared using Word Perfect under windoze. Hovering over the file in konqueror the bar at the bottom tells me that it knows it is a Word Perfect file. Changing the file name extension from wpd to doc makes no difference - it still knows that this is a Word Perfect file. This one is a very simple file, but Open Office opens it just fine and displays all the text in it very nicely, thanks very much.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]