file doesn't recognize .hs files as haskell, thinks they're java

Bug #268365 reported by Mackenzie Morgan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
file (Debian)
Confirmed
Unknown
file (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: file

To reproduce:
Create a Haskell file ending in .hs (ex: xmonad.hs)
Run file on that file "file xmonad.hs"
Note that output claims it is a Java file:

$ file xmonad.hs
xmonad.hs: ASCII Java program text
$ file -i xmonad.hs
xmonad.hs: text/x-java; charset=us-ascii

Changed in file:
importance: Undecided → Low
Changed in file:
status: Unknown → New
Revision history for this message
Benjamin Schulz (sl0wpoke) wrote :

This bug is confirmed by the man page for file(1), which on Ubuntu 10.10 was last modified 2008-10-09. The text implies that the issue might be fixed manually, but that recompilation is required. The page also suggests, however, that reliable categorization of text files, specifically program source texts, remains something of an open problem.

Was able to reproduce this bug. Also noticed that file(1) gives different answers for different *.hs files, e.g.

ASCII Java program text, with CRLF line terminators

and

Lisp/Scheme program text

For two different Haskell source files suffixed with '.hs'.

Changed in file (Ubuntu):
status: New → Confirmed
Revision history for this message
Micah Gersten (micahg) wrote :

Marking triaged per sl0wpoke in #ubuntu-bugs after I confirmed it affected oneiric as well

Changed in file (Ubuntu):
status: Confirmed → Triaged
Changed in file (Debian):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.