diff options
author | Lars Wirzenius <liw@liw.fi> | 2009-02-03 12:48:06 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2009-02-03 12:48:06 +0200 |
commit | 7ddb4d64810f3e58b43798de7f2dc2bf67df59d5 (patch) | |
tree | 1643b961bae8468ce09d4e36dcf5b57715840d56 /errno | |
parent | a71f4cce9ad601767102109afb4fed6dd7f7b95f (diff) | |
download | extrautils-7ddb4d64810f3e58b43798de7f2dc2bf67df59d5.tar.gz |
Added errno.
Diffstat (limited to 'errno')
-rwxr-xr-x | errno | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -0,0 +1,16 @@ +#!/usr/bin/python + +import errno +import os +import sys + +toname = dict((str(getattr(errno, x)), x) for x in dir(errno) if x.startswith("E")) +tocode = dict((x, getattr(errno, x)) for x in dir(errno) if x.startswith("E")) + +for arg in sys.argv[1:]: + if arg in tocode: + print arg, tocode[arg], os.strerror(tocode[arg]) + elif arg in toname: + print toname[arg], arg, os.strerror(int(arg)) + else: + print "Unknown:", arg |