Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Content based file type determination?
Content based file type determination? [message #197573] Fri, 02 March 2007 15:48 Go to next message
Eclipse UserFriend
Originally posted by: firstname.lastname.chelloDOT.at

I am using Eclipse for several different languages, including scripting
languages like perl and ruby.

So it can happen that files without an extension are either perl, ruby
or other files, but I could not figure out how to tell Eclipse how to
find out about the file type.

An easy way that is standard under Linux is to look at the first line
within the file which contains either a mode line or a #! line that
will easily identify the file type.

Is there a way to make Eclipse decide on the correct file type based
on the first one or two lines within the file?

Extensions are really the anachronistic, Windows-style way of
identifying file types.
Re: Content based file type determination? [message #197631 is a reply to message #197573] Fri, 02 March 2007 20:32 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Johann,

I'm not sure there is a way without implementing and installing a plugin
that implements an IContentDescriber.


Johann Petrak wrote:
> I am using Eclipse for several different languages, including scripting
> languages like perl and ruby.
>
> So it can happen that files without an extension are either perl, ruby
> or other files, but I could not figure out how to tell Eclipse how to
> find out about the file type.
>
> An easy way that is standard under Linux is to look at the first line
> within the file which contains either a mode line or a #! line that
> will easily identify the file type.
>
> Is there a way to make Eclipse decide on the correct file type based
> on the first one or two lines within the file?
>
> Extensions are really the anachronistic, Windows-style way of
> identifying file types.
>
>
Previous Topic:Dependent library in eclipse
Next Topic:SelectionChanged event in MultiPageEditorPart
Goto Forum:
  


Current Time: Thu Apr 25 13:51:08 GMT 2024

Powered by FUDForum. Page generated in 0.10371 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top