[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Determine mime type of a file
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 2 May 2011 11:09:49 +0200
On Mon, May 2, 2011 at 10:55 AM, Marco <netuse@lavabit.com> wrote:
> How can I determine the mime type of a file (like the unix
> command “file -i <some_file>”)?
Why not just this? ;)
local type = io.popen('file -i '..myfile):read()
Otherwise, you need a catalog, and that is dependent on system setup
on something like Gnome, which provides such a thing helpfully encoded
as XML.
steve d.