def scan(): ThreadKeeper.incrementThreadCount() captureInterface = str(ConfigHelper.getWirelessCaptureInterface()) captureDuration = str(ConfigHelper.getCaptureDuration()) capturePath = str(ConfigHelper.getCaptureDirectory()) + \ ThreadKeeper.getTimeStamp() + \ "-unprocessed.pcap" try: # making the saved pcap able to be deleted by normal users since it was created with root call(["touch", capturePath]) call(["chmod", "777", capturePath]) except Exception, errmsg: print "Could not change output file permissions, you might need root permissions to delete it now, sorry about that..." print errmsg
def __removePcaps(): # http://stackoverflow.com/questions/1995373/ path = str(ConfigHelper.getCaptureDirectory()) [os.remove(path + f) for f in os.listdir(path) if f.endswith(".pcap")]