'file -i' gives long description, not mime string

Bug #104912 reported by Christian Convey
4
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Christian Convey

Bug Description

The command "file -i <filename>" is supposed to list the mime type of a file, rather than a longer, human-readable version of the file's type.

When I run this command, however: "file -i test.pdf", I get this output:
test.pdf: PDF document, version 1.3

It should have been something *like*, "test.pdf: application/pdf" (I'm not sure exactly what the proper mime-type string is for PDFs.)

I'm using pre-released Feisty Fawn (up-to-date as of 9 April 2007). I'll attach test.pdf in a moment.

Revision history for this message
Christian Convey (christian-convey) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote :

I am unable to confirm this here. The output I got from your test file is:

test.pdf: application/pdf

Does the problem happen for you with other file types or just PDF?

Revision history for this message
Christian Convey (christian-convey) wrote : Re: [Bug 104912] Re: 'file -i' gives long description, not mime string

You can close the bug.

I figured out the problem, and it's not Ubuntu's fault.

I had created a symlink: /etc/magic.mime as a symlink pointing at
/usr/share/file/magic. This was to make a module in PHP's PECL
library work, and was recommended by a posting in some newsgroup.
Making the symlink did solve that PHP problem, but apparently borked
the 'file' program in some way.

Removing the symlink caused 'file -i' to work correctly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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