+ shutil.copyfile(from_file, to_file)
+ try:
+ shutil.copymode(from_file, to_file)
+ except:
+ pass
+ return True
+
+
+def create_dir(new_dir):
+ "Try to create the output directory if it doesn't exist"
+ if not os.path.isdir(new_dir):
+ try:
+ os.makedirs(new_dir)
+ except:
+ error("Unable to create %s" % new_dir)
+ return False
+ return True