Opened 6 years ago

Closed 6 years ago

#10917 closed bug (duplicate)

File extension not used to deduce file type when mimetype doesn't exist

Reported by: xray7224 Owned by: bonefish
Priority: normal Milestone: R1
Component: Servers/registrar Version: R1/Development
Keywords: Cc:
Blocked By: #10067 Blocking:
Platform: All


I don't know if I've misunderstood the file type detection used in Haiku however, If there is a file without a mimetype file attribute (e.g. on a non-BFS volume) then it doesn't seem to use the file extension to deduce what type it is.

I have a HTML file ext4 volume which obviously doesn't have the mimetype attribute, when I double click the file to open it, it will open in StyledEdit. I have checked in Preferences > FileTypes and it says the preferred application is WebPositive and also it does have the ".htm" and ".html" file extensions associated with it. If I open the get info on the file it says "Kind: Generic file" suggesting it's not used the ".html" file extension to deduce the file type.

I suggest that if the mimetype isn't present what format a file is should be deduced by it's file extension (if possible).

I am using nightly hrev47325

Change History (3)

comment:1 by pulkomandy, 6 years ago

We don't use file extensions for this. In Preferences > Filetypes you can see the sniffing rule used. Sniffing rules try to detect known patterns in the file content to identify it. Unfortunately, there are files which are difficult to detect this way, and HTML is one such case. If you share the problematic file, we may be able to improve our sniffing rule to detect it properly.

comment:2 by diver, 6 years ago

Component: - GeneralServers/registrar
Keywords: file type filter detection removed
Owner: changed from nobody to bonefish

comment:3 by diver, 6 years ago

Blocked By: 10067 added
Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.