[ANNOUNCE] File::MimeInfo 0.3

Jaap Karssenberg j.g.karssenberg at student.utwente.nl
Wed Aug 27 04:07:51 EEST 2003


On 26 Aug 2003 23:11:08 +0100 Mike Hearn wrote:
: Is file(1) ever going to be ported, or would that be an unacceptable
: break of compatability?

Dunno -- I'm not the file(1) maintainer nor do I know the file(1)
maintainer. But I think my script is as close as it gets. The next
release (version 0.4) will also support the freedesktop magic file -
this is all ready implemented and in cvs (awaiting answer from Thomas
Leonard on some issue).

As far as I see file(1) has human readable output ( == not machine
friendly), thus I do not suppose it to find much usage in system
scripts. Also I noticed that the switches of the current file(1) command
almost completely differ from the POSIX spec, this might also suggest
that no portable scripts can/should rely on file(1).

If no (important) scripts rely on it, it won't break anything when you
simply remove file and symlink /usr/bin/file to /usr/bin/mimetype
(please notice that mimetype will alter it's default behaviour to be
more compatible if you do this)

I cooked up a small perl script[1] to find all shell scripts in default
system directories that use file -- it uses File::MimeInfo to
distinguish shell scripts :)).

It turns out that on my system[2] only /usr/bin/lesspipe.sh and
/usr/bin/pj-gs.s use file(1), both not really vital scripts.

Next I just replaced file(1) with a symlink to mimetype (cvs version)
and rebooted. No errors whatsoever.

[1] http://zoidberg.student.utwente.nl/~pardus/files/find_file.pl
[2] up2date Gentoo GNU/Linux system

-- 
   )   (       Jaap Karssenberg || Pardus [Larus]
   :   :       http://pardus-larus.student.utwente.nl/~pardus
 )  \ /  (    
 ",.*'*.,"     " Where computers are concerned _always_ be paranoid "



More information about the xdg mailing list