By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

Pure Python equivalent of unix "file" command?

P: n/a
W3
Hi all,

Just a quick one... Is there such a thing?

Thanks,
/Walter
--

Jul 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Thu, Jul 19, 2007 at 03:29:35PM -0400, W3 wrote:
Just a quick one... Is there such a thing?
Debian et al ship Python bindings[0] for file(1)[1]. file works by
using a file (/etc/magic) with 'magic' numbers in it to figure out
the type of a file. Googling 'python magic' will turn up a few
interesting threads.

[0] http://packages.debian.org/unstable/python/python-magic
[1] http://www.darwinsys.com/file/

--

[Will Maier]-----------------[wi*******@ml1.net|http://www.lfod.us/]
Jul 19 '07 #2

P: n/a
Take a look at
http://www.demonseed.net/~jp/code/magic.py

W3 wrote:
Hi all,

Just a quick one... Is there such a thing?

Thanks,
/Walter
Jul 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.