ncannasse 10 anni fa
parent
commit
e3a2bdf422
1 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 13 0
      hxd/File.hx

+ 13 - 0
hxd/File.hx

@@ -156,6 +156,19 @@ class File {
 		#end
 		#end
 	}
 	}
 
 
+	public static function delete( path : String ) {
+		#if air3
+		try {
+			getRelPath(path).deleteFile();
+		} catch( e : Dynamic ) {
+		}
+		#elseif sys
+		try sys.FileSystem.deleteFile(path) catch( e : Dynamic ) { };
+		#else
+		throw "Not supported";
+		#end
+	}
+
 	public static function getBytes( path : String ) : haxe.io.Bytes {
 	public static function getBytes( path : String ) : haxe.io.Bytes {
 		#if air3
 		#if air3
 		var file = getRelPath(path);
 		var file = getRelPath(path);