When trying to write dirt results to file you get argument list to long. Fix it with below code
Old Code
subprocess.check_output("replace INSERTDIRBSCAN \"" + data + "\" -- " + path, shell=True)
Fixed Code
subprocess.check_output("replace INSERTDIRBSCAN \"" + "%s".format(data) + "\" -- " + path, shell=True)