[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 14:46:40 +0200
On Mon, May 2, 2011 at 11:22 AM, Dirk Laurie <dpl@sun.ac.za> wrote:
> Unfortunately io.popen "is system dependent and is not available on
> all platforms."
Well, all _desktop_ platforms, certainly (it can be dodgy on Windows
with GUI subsystem applications). But then there's always os.execute()
+ redirection to a temp file.
Adrian has a good suggestion, but it seems easier to parse the output
of 'file' than to do a library binding.
steve d.