RE: [Pythonmac-SIG] magic file info

2005-02-22 Thread Henning.Ramm
/usr/bin/magic determines the file type heuristically by parsing 
/usr/share/file/magic and then reading a couple bytes out of the given 
file.

This appears to be a direct Python translation of the file command, 
with an embedded copy of a magic table:
http://www.demonseed.net/~jp/code/magic.py

Thank you! I could have written a magic parser myself, but it's better if I 
don't need to. ;-)
I only thought there would be a standard module that I overlooked.

Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] magic file info

2005-02-21 Thread Henning.Ramm
I'm looking for a way to retrieve a file's type - not (only) Mac type/creator, 
but like what the shell command 'file' returns.


Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] magic file info

2005-02-21 Thread Bob Ippolito
On Feb 21, 2005, at 4:29 AM, [EMAIL PROTECTED] wrote:
I'm looking for a way to retrieve a file's type - not (only) Mac 
type/creator, but like what the shell command 'file' returns.
/usr/bin/magic determines the file type heuristically by parsing 
/usr/share/file/magic and then reading a couple bytes out of the given 
file.

This appears to be a direct Python translation of the file command, 
with an embedded copy of a magic table:

http://www.demonseed.net/~jp/code/magic.py
-bob
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig