LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-14-2003, 03:07 PM   #1
gag
LQ Newbie
 
Registered: Oct 2003
Location: Colchester
Distribution: Red Hat 9
Posts: 16

Rep: Reputation: 0
File Associations


Hi all,
I've been browsing some books from the library and looking at some screen shots of 'konqueror' and seen .jpg and .gif files amongst others which obviously proves that these extensions are recognised. Also however, there are files which appear to have no extension and a number of README files. eg. Readme.config, Readme.dri, Readme.sis etc. (I am assuming here that files named Readme are text files which can be read). Now coming, nay fleeing, as I am from windows, I would expect the extensions of these files to be the same ( e.g. txt) so they could be opened with the same app. Am I wrong or is there a different method of associating files?
Please note that I don't have a Linus system as such but it is in the post as I speak! (Red Hat 9)
Thanks
 
Old 10-14-2003, 04:25 PM   #2
dxdad
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 75

Rep: Reputation: 15
KDE looks at the contents of the file and decides what would be good to us to open it. based on it's MIME type, I think.
 
Old 10-14-2003, 04:36 PM   #3
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
Linux can use 2 methods to identify file types:

1. Magic Number- a hex code embedded near the beginning of the file. The various registered codes are listed in /usr/share/magic.

2. File extensions- Linux can use file extensions to determine filetype. The extention associations are buried in some deep dark file whose name I've forgotten.
 
Old 10-14-2003, 11:56 PM   #4
rahulsundaram
Member
 
Registered: May 2003
Location: India
Distribution: Knoppix, RedHat
Posts: 246

Rep: Reputation: 30
hi

the bottom line is file extensions are irrelevant. create a file with a .txt extension then its mime type/magic number becomes text. renaming it doesnt
doesnt change the filetype. you can find it out by


file filename in command line

in KDE

right click and view properties. you can also change the filetype in the context menu. Gnome should have similar options

regards
rahul sundaram
 
Old 10-15-2003, 12:46 AM   #5
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
Quote:
Originally posted by rahulsundaram
the bottom line is file extensions are irrelevant.
Look into "binfmt_misc"; files can be registered by extention. Granted, this isn't the usual mechanism, but still, it can be done.

 
Old 10-15-2003, 01:14 PM   #6
gag
LQ Newbie
 
Registered: Oct 2003
Location: Colchester
Distribution: Red Hat 9
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you all very much.
 
Old 10-15-2003, 04:34 PM   #7
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
You're welcome.
 
  


Reply



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
File Associations Altec_ Linux - Software 3 02-08-2005 01:43 PM
File associations HH42 Linux - Newbie 4 01-28-2005 09:48 AM
File Associations n0rman- Linux - Software 4 09-19-2004 07:01 AM
file associations cadj Linux - Distributions 0 04-25-2004 03:13 AM
File Associations M$ISBS Linux - Software 0 08-22-2003 05:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 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
Open Source Consulting | Domain Registration