file doesn't recognize .hs files as haskell, thinks they're java
Bug #268365 reported by
Mackenzie Morgan
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 |
Changed in file (Debian): | |
status: | New → Confirmed |
To post a comment you must log in.
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'.