Переглянути джерело

[lua] Use a windows-compatible FileSystem exist method

Justin Donaldson 7 роки тому
батько
коміт
86d632d732
1 змінених файлів з 2 додано та 6 видалено
  1. 2 6
      std/lua/_std/sys/FileSystem.hx

+ 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;
 		}
 	}