浏览代码

* Fixed FileExists for >2GB files

git-svn-id: trunk@5929 -
michael 18 年之前
父节点
当前提交
ea0fc335d1
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      rtl/unix/sysutils.pp

+ 3 - 3
rtl/unix/sysutils.pp

@@ -269,10 +269,10 @@ end;
 
 Function FileExists (Const FileName : String) : Boolean;
 
-Var Info : Stat;
-
 begin
-  FileExists:=fpstat(filename,Info)>=0;
+  // Don't use stat. It fails on files >2 GB.
+  // Access obeys the same access rules, so the result should be the same.
+  FileExists:=fpAccess(filename,F_OK)=0;
 end;