pastojs: fixed DirectoryExists using FileAttr

git-svn-id: trunk@43159 -
This commit is contained in:
Mattias Gaertner 2019-10-09 21:01:03 +00:00
parent e0041a8244
commit 01f82551a4

View File

@ -905,7 +905,14 @@ end;
function TPas2jsCachedDirectories.DirectoryExists(Filename: string): boolean;
var
Info: TFileInfo;
Dir: TPas2jsCachedDirectory;
begin
Info.Filename:=Filename;
if not GetFileInfo(Info) then exit(false);
if Info.Dir<>nil then
Result:=(Info.Dir.FileAttr(Info.ShortFilename) and faDirectory)>0
else
begin
Dir:=GetDirectory(Filename,true,false);
if Dir<>nil then
@ -918,6 +925,7 @@ begin
Result:={$IFDEF pas2js}NodeJSFS{$ELSE}SysUtils{$ENDIF}.DirectoryExists(Filename);
end;
end;
end;
function TPas2jsCachedDirectories.FileExists(Filename: string): boolean;
var