How to stop file type changing automatically

Roshan Mansinghani rosh1182 at gmail.com
Mon Aug 14 16:33:08 UTC 2006


I have reproduced what you are talking about.  First, the file is not
actually being changed or renamed to a .html extension.  The only thing that
is happening is that Konqueror is guessing that this is an html file and
giving you options corresponding with its guess.  So, the question is, do we
have a way to tweak konqueror so that it doesn't "guess" the filetype by
parsing the file and instead only assigns MIME types based on extensions.
One option you have is to use file extensions when you name things, then set
up konqueror to some default behavior when it encounters files with that
extension.  But, if this file is a config file for gvim, perhaps you don't
have the option of renaming it in anyway.  Again, some research needs to be
done that clarifies if this feature of konqueror can be turned off.

On 8/14/06, marc <gmane at auxbuss.com> wrote:
>
> Roshan Mansinghani said...
> > On 8/13/06, marc <gmane at auxbuss.com> wrote:
> > >
> > > Heyho,
> > >
> > > My config file for gvim has been given the .html file type. This
> results
> > > in it being opened by Firefox, when opened via a file manager. Not
> what
> > > I want.
> > >
> > > Taking a closer look, this behaviour occurs when the file contain a
> > > <script> entry. In other words, the file happily lives life as a text
> > > file type until an edit is saved containing the text "<script>", when
> > > it, immediately and without notification, automatically changes its
> file
> > > type to .html
> > >
> > > How do I stop this from happening?
> > >
> > > It reminds me of Microsoft's Clippy - but rather worse - because it
> > > doesn't tell me it's doing it, and it and doesn't give me the option
> top
> > > stop it.
> > >
> > > For now, I've added a filename patterns to text/plain of .*, which
> might
> > > well be sufficient.
> > >
> > > It also begs the question of when and where this changing is done.
> > > Frankly, I can't conceive of a time when I'd want this behaviour.
>
> > Does this happen only in gvim or if you use another editor (say, Kate)
> do
> > you have the same problem?
>
> Oh, it's not the editor. I can copy my (now protected) .gvimrc to
> another directory and, as soon as I rename it to gvimrc it "becomes" an
> HTML mime type. If I then rename it to gvimrc.txt, then it becomes a
> text/plain type again.
>
> Try it. Create an empty text file called fred. Add some text and it will
> behave as a regular text file. Now, add the lines:
>
> <script>
> <script>
>
> save it, and it's changed to an HTML file type. You can use any editor
> to do this. (If you only use one line containing <script>, then the type
> doesn't change. It knows what it's looking for :-) )
>
> I thought that it might be associated with Desktop/Behaviour/File
> icons/Show icon previews, but I switched them off for text and HTML
> files and it still happens.
>
> What is parsing files to cause this? I want it to stop!
>
> --
> Best,
> Marc
>
>
> --
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20060814/fb1ce160/attachment.html>


More information about the kubuntu-users mailing list