How could I associate a file type with a program?
How could I do it programatically?
|
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? |
I need to do this from inside a program, by code.
Thanks for your answer. |
What exactly your program needs to do? Only then we can explain how it can be done.
|
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.
|
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.
|
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. |
Have a look here.
|
That's it. Thank you.
|
All times are GMT -5. The time now is 10:58 PM. |