From 9142061d8308b08b3299bccfdf04f2e955b3a43c Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Mon, 4 Feb 2008 20:14:32 -0500
Subject: [PATCH] Catch non-existing files in logtool.

---
 bin/logtool | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/logtool b/bin/logtool
index 0171093..19b3e80 100755
--- a/bin/logtool
+++ b/bin/logtool
@@ -129,7 +129,11 @@ following:
             print logmgr.quantity_data[args.pop(0)].table
         else:
             # not a known command, interpret as file name
-            logmgr = LogManager(cmd)
+            from os import access, R_OK
+            if access(cmd, R_OK):
+                logmgr = LogManager(cmd)
+            else:
+                raise IOError, "file '%s' not found" % cmd
 
     if did_plot:
         from pylab import show, title, legend, axis, grid
-- 
GitLab