LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2007, 04:22 AM   #1
antoniog
Member
 
Registered: Apr 2007
Posts: 44

Rep: Reputation: 15
How could I associate a file type with a program?


How could I do it programatically?
 
Old 04-08-2007, 04:27 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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?
 
Old 04-08-2007, 04:32 AM   #3
antoniog
Member
 
Registered: Apr 2007
Posts: 44

Original Poster
Rep: Reputation: 15
I need to do this from inside a program, by code.

Thanks for your answer.

Last edited by antoniog; 04-08-2007 at 05:32 AM.
 
Old 04-08-2007, 07:38 AM   #4
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
What exactly your program needs to do? Only then we can explain how it can be done.
 
Old 04-08-2007, 02:22 PM   #5
antoniog
Member
 
Registered: Apr 2007
Posts: 44

Original Poster
Rep: Reputation: 15
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.
 
Old 04-08-2007, 04:45 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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.
 
Old 04-08-2007, 06:34 PM   #7
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
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.
 
Old 04-08-2007, 06:40 PM   #8
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
Have a look here.
 
Old 04-09-2007, 05:49 AM   #9
antoniog
Member
 
Registered: Apr 2007
Posts: 44

Original Poster
Rep: Reputation: 15
That's it. Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
associate program PlatinumRik Linux - General 2 10-31-2005 09:33 AM
How I can associate the right application back to a .desktop file? carbono Red Hat 0 08-07-2004 04:36 PM
associate/register file extensions gSalsero Programming 3 06-04-2004 04:29 AM
associate mailto in firefox to a program true_atlantis Linux - Software 1 04-26-2004 03:39 PM
how do i associate programs with file types? drrnsk8ter4 Linux - Software 2 04-25-2004 08:22 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration