From 1d02b3102b5048390745ed2ca8c2f6ba756559a0 Mon Sep 17 00:00:00 2001 From: jowj Date: Mon, 27 Jan 2020 16:19:40 -0600 Subject: [PATCH] Check for file before trying to read it. --- arke.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arke.py b/arke.py index d5b8a75..55c09c6 100644 --- a/arke.py +++ b/arke.py @@ -91,7 +91,10 @@ while is_on: # track state file = open("/shared/results.json", "r") - stateFile = open("/shared/state.log", "r") + if os.path.exists("/shared/state.log"): + stateFile = open("/shared/state.log", "r") + else: + stateFile = open("/shared/state.log", "w+") oldData = stateFile.read() if oldData != file.read():