Selaa lähdekoodia

Fix file already exists

mingodad 9 vuotta sitten
vanhempi
sitoutus
7931de0ac8
1 muutettua tiedostoa jossa 10 lisäystä ja 3 poistoa
  1. 10 3
      SquiLu/samples/dump-har.nut

+ 10 - 3
SquiLu/samples/dump-har.nut

@@ -100,9 +100,16 @@ function dumpContent(vhar)
 			print(path, content.len());
 			print(path, content.len());
 			
 			
 			local full_path = dest_folder + path;
 			local full_path = dest_folder + path;
-			local fdc = file(full_path, "w");
-			fdc.write(content);
-			fdc.close();
+			try
+			{
+				local fdc = file(full_path, "w");
+				fdc.write(content);
+				fdc.close();
+			}
+			catch(e)
+			{
+				print(e);
+			}
 		}
 		}
 	}
 	}
 }
 }