Announcement

Collapse
No announcement yet.

File type identification inconsistent in dolphin

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    File type identification inconsistent in dolphin

    I noticed strange behavior today in Dolphin. When browsing a directory of matlab scripts (*.m files) the file type reported by dolphin was inconsistent. Files were either reported as Objective-C source code, MATLAB script/function, or TeX documents. Objective-C or MATLAB are fine since the file associations are setup for that and they both have *.m extensions, but I can't explain why Dolphin would identify a *.m file as a TeX document. I checked in the file association setting and *.m does not map to any type of TeX document.

    I tested further, and it turns out that if I remove the "%" from the first line in the file then Dolphin says it is either Objective-C or MATLAB. The "%" character starts comments in TeX, MATLAB, and Octave so it makes sense the there could be some confusion between MATLAB and TeX if the file extension is not known. But why would it set the type as TeX when the file has a .m extension? Is this intended behavior?

    #2
    Re: File type identification inconsistent in dolphin

    It is not the Dolphin, it is the KDE.

    Making a test file: Test.m, it only has the % character. The kmimetypefinder /1/ tells:
    :~$ kmimetypefinder Test.m
    text/x-tex
    (accuracy 10)
    but the xdg-mime /2/ tells:
    :~$ xdg-mime query filetype Test.m
    text/x-objcsrc

    I think that KDE tries to be clever, it looks the mime type but it also looks inside the file. Sometimes this will give a wrong answer. Maybe a place to make a bug report ?


    /1/ kmimetypefinder --help
    Usage: kmimetypefinder [Qt-options] [KDE-options] filename

    Gives the mimetype for a given file
    /2/ man xdg-mime
    NAME
    xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file
    types

    SYNOPSIS
    xdg-mime query {filetype default} ...
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Re: File type identification inconsistent in dolphin

      Thanks for the info! I filed a bug: https://bugs.kde.org/show_bug.cgi?id=196212

      Comment

      Working...
      X