From 7ddb4d64810f3e58b43798de7f2dc2bf67df59d5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 3 Feb 2009 12:48:06 +0200 Subject: Added errno. --- errno | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 errno (limited to 'errno') diff --git a/errno b/errno new file mode 100755 index 0000000..2a39e2f --- /dev/null +++ b/errno @@ -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 -- cgit v1.2.1