LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How could I associate a file type with a program? (https://www.linuxquestions.org/questions/linux-newbie-8/how-could-i-associate-a-file-type-with-a-program-544213/)

antoniog 04-08-2007 03:22 AM

How could I associate a file type with a program?
 
How could I do it programatically?

acid_kewpie 04-08-2007 03:27 AM

what do you mean programatically? file type assocations are generally held within the level of a file manager app of a desktop environment like gnome or kde. you'd need to look at your DE of choice as there's no accross the board mechanism that you'd use.

maybe a please / thankyou next time?

antoniog 04-08-2007 03:32 AM

I need to do this from inside a program, by code.

Thanks for your answer.

anupamsr 04-08-2007 06:38 AM

What exactly your program needs to do? Only then we can explain how it can be done.

antoniog 04-08-2007 01:22 PM

I need to install the program and, at the first time it runs, it needs to make .TXT file association. It's a text file editor.

acid_kewpie 04-08-2007 03:45 PM

yeah we've already told you this is a desktop environment / file manager thing. if you don't understand the advice you're given, don't just ignore it.

anupamsr 04-08-2007 05:34 PM

Hmm... tricky question.

The association of a file with a program is not a responsibility of operating system. Thus, there is no such association which will work, so to say, on "Linux". This criteria is a responsibility of Desktop environment the user is working in.

In Windows, there is only one desktop environment. On Linux, some may use KDE, other may use Gnome, and still other may use Fluxbox, or Windowmaker, or any number of choices available. All these have different approach for any problem, and there is no standard. As of now there is no standard way to associate a file with a program. What you may do however, is to write something for KDE and Gnome. These are most popular DEs, and in case user is using something else, you can pretty much assume that he does not need such associations.

anupamsr 04-08-2007 05:40 PM

Have a look here.

antoniog 04-09-2007 04:49 AM

That's it. Thank you.


All times are GMT -5. The time now is 10:58 PM.