Browse Source

Fix file already exists

mingodad 9 năm trước cách đây
mục cha
commit
7931de0ac8
1 tập tin đã thay đổi với 10 bổ sung3 xóa
  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());
 			
 			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);
+			}
 		}
 	}
 }