From 49dc0d5611b715c5108eceee88f22edda374e5c8 Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Thu, 31 Jan 2019 22:39:06 -0800 Subject: [PATCH] Added check and exception for writable folders --- Interlace/lib/core/input.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 492a2f7..20b67b2 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -2,6 +2,7 @@ from argparse import ArgumentParser from netaddr import IPNetwork, IPRange, IPGlob from Interlace.lib.core.output import OutputHelper, Level import os.path +from os import access, W_OK import sys from re import compile @@ -68,6 +69,10 @@ class InputHelper(object): final_commands = set() output = OutputHelper(arguments) + # checking for whether output is writable and whether it exists + if not access(arguments.output, W_OK): + raise Exception("Directory provided isn't writable") + if arguments.port: if "," in arguments.port: ports = arguments.port.split(",")