Content based file type determination? [message #197573] |
Fri, 02 March 2007 15:48 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.10371 seconds