LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 04: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, 05: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, 05: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-15-2003, 12:56 AM   #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, 01: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, 02: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, 05: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


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


All times are GMT -5. The time now is 01:45 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration