2
0
Эх сурвалжийг харах

[lua] Use a windows-compatible FileSystem exist method

Justin Donaldson 7 жил өмнө
parent
commit
86d632d732

+ 2 - 6
std/lua/_std/sys/FileSystem.hx

@@ -32,12 +32,8 @@ class FileSystem {
 	public static function exists( path : String ) : Bool {
 		if (path == null) return false;
 		else{
-			var f = Io.open(path);
-			if (f == null) return false;
-			else {
-				f.close();
-				return true;
-			}
+			var res = LFileSystem.stat(path);
+			return res.result != null;
 		}
 	}