+ fin = os.open("/vsys/publickeys.in", os.O_NONBLOCK | os.O_WRONLY)
+ fout = os.open("/vsys/publickeys.out", os.O_NONBLOCK | os.O_RDONLY)
+
+ in_flags = fcntl.fcntl(fin, fcntl.F_GETFL)
+ out_flags = fcntl.fcntl(fin, fcntl.F_GETFL)
+
+ res = select.select([fout], [], [])
+
+ fcntl.fcntl(fin, fcntl.F_SETFL, in_flags & ~os.O_NONBLOCK)
+ fcntl.fcntl(fout, fcntl.F_SETFL, out_flags & ~os.O_NONBLOCK)
+
+ f = os.fdopen(fout, "r")
+ return f.read()
+
+def all_keys():
+ keys = read_keys()
+
+ files = {}
+ num = 0
+ for line in keys.split('\n'):
+ line = line.strip()
+ fields = line.split()
+ try:
+ name = fields[2]
+ files[name] = line
+ except:
+ num += 1
+ files["unnamed_key%d" % num] = line
+
+ return files