File associations

This is a discussion on File associations within the Linux Programming forums, part of the Platform Specific Boards category; Hi I'm looking for a way to access file associations under Linux. I know that KDE and Gnome have such ...

  1. #1
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892

    File associations

    Hi

    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.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #2
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    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
    ls -l

    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.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    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.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    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

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    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?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 09:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21