Functions: updated pathToFile, added mkDirNoOSErr and switched across to scandirs to replace os.walk