On Tuesday 06 March 2007 12:47, James Knott wrote:
> Johnny Andersson wrote:
> > So how does Linux know what program to open a certain file with? I
> > will soon
> > install Linux on at least one of my machines, so it would be
> > interesting to
> > know. I just would love to get rid of that file extension shit, which
> > annoyed me since about 1998 or so…
>
> I could be wrong (yes, that has actually happened before <g>), but I
> believe it's encoded in the first few bytes of the file.  Not certain
> about that though.
It looks at the content of the file according to various magic strings in 
various odd places. Look at the man pages for the command 'file', i.e. go to 
the command line and type
  man file
and see how it works and where the descriptors are. Very occasionally it can 
get it wrong, especially with different types of text file. I think it falls 
back on an extension if all else fails, but not sure about that.

But that is from the command line - desktop guis may be different, though.

> In OS/2, the files have up to 64K bytes of extended 
> attributes, so the file "knows" what applications can work with it.
>
> > By the way, there are some cases when file extensions are needed in Linux
> > too, aren't there? For example .c, .g++, .h, .o, .tar etc.

No; there's a difference between convention and necessity.

> > Doesn't an OGG 
> > file in Linux need the .ogg extension?
>
> That I don't know about.  Also, file associations are a desktop thing.
> The command line doesn't know about them.
-- 
Andy Pepperdine

On this mailing list help is provided by volunteers.
Please subscribe to the mailing list to see all the replies to a query,
and reply only to the mailing list.

For FAQ, userguide, see: http://documentation.openoffice.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to