in reply to Re: Cross-platform open document
in thread Cross-platform open document

To be precise: No, Linux does not use MIME types.

Linux is "just" an operating system kernel. The userland tools around it do not use the MIME types, either. The Free Desktop Project uses MIME types, so desktop environments like Gnome and KDE that use that standard can use the shared MIME database. But as I already said, not every desktop environment uses that standard or the database.

Oh, and there is no information in /usr/share/mime about which application is able to open a resource (file) with any given MIME type. Just look at /usr/share/mime/text/html.xml. If /usr/share/mime was the right place to look at, I should be able to find the name of my prefered browser in that file. But there is no application listed at all, and that is not the purpose of this database.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^3: Cross-platform open document
by stefbv (Priest) on Mar 01, 2010 at 07:58 UTC

    True, not "Linux" but "GNU/Linux" as a generic name for the entire system, more specifically those systems with GNOME or KDE.

    Of course CLI tools doesn't need and can't use MIME, that is only for graphical desktop interface apps.

    The database is for "looking up the correct MIME type..."

    The user preferences (such as a user's preferred application for handling files of a particular type) are stored in the home dir of the user.

    "There is no information in /usr/share/mime about which application is able to open a resource (file) with any given MIME type."

    Not entirely true, from the link you provided:

    "It may be used to store static information, such as that files of a certain type may be viewed with a particular application."

    Regards, Stefan

      CLI tools doesn't need and can't use MIME, that is only for graphical desktop interface apps

      My mutt (which I wouldn't consider a graphical desktop app) nicely makes use of MIME types... :)  — more specifically, it uses ~/.mailcap and/or /etc/mailcap plus ~/.mime.types and/or /etc/mime.types for viewing/handling attachments.

      </nitpick>