mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 21:49:06 +02:00
pastojs: fixed DirectoryExists using FileAttr
git-svn-id: trunk@43159 -
This commit is contained in:
parent
e0041a8244
commit
01f82551a4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user