I'm looking for a way to access file associations under Linux. I know that KDE and Gnome have such a list. Is there any function or tool that I can use to find out which program is associated with a specific file type? Preferably one that works with both environments and is easily accessible from Java, but separate tools/functions for the two that are only accessible from C++ will do too, I can use JNI.
Thx in advance.
You are a little confused in your question I think. A file association is its ability to be read/write/execute a program by root, users, or other respectivly. If you want to see the file associations that would be
I think you are talking about file extensions what programs MIME types for Mozilla. Usually a program will claim its extension. Why do you want the list maybe there is there another way to do what you want.:)
Yes, I'm asking about MIME types/extension claiming.
In particular, I want to achieve the same effect in my program that you get when double-clicking a data file in Windows Explorer or Konqueror. The environment stores a extension-to-application map somewhere and looks up the application to launch. I want to access this map, if possible for KDE and Gnome.
What do you want to open. First you figure that out. Say you want to open pdfs first you go to a place on the web that has pdfs click it and figure out its MIME type. a pdf is know to mozilla as application/pdf. Then you go to your Edit->Preferences->Navigator->Helper Applications->New Type
For MIME type you fill in application/pdf then select open with(depending on where you installed xpdf) /bin/xpdf
Hope this helps:)
No, unfortunatly it doesn't. I can't go anywhere on the web, and this isn't really about mozilla.
I am writing an information organisation application. This application can have files embedded in its data structures, and I need to give the user the option to launch these files with appropriate applications. Since both KDE and Gnome store the appropriate applications for file types or mime types, I believe there must be some way to find out programmatically and use this information.
My question is, how?