소스 검색

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