浏览代码

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