On my Linux PC (Debian testing) the magic files are configured for the 'file' utility. It processes both /etc/magic.mime and /usr/share/file/magic.mime. Your program only processes the first of these files found. /etc/magic.mime contains only local definitions, and on my PC is empty. As a consequence, all files are reported to have the mime type application/x-unknown-mime-type. I believe you...