|
@@ -905,17 +905,25 @@ end;
|
|
|
|
|
|
function TPas2jsCachedDirectories.DirectoryExists(Filename: string): boolean;
|
|
|
var
|
|
|
+ Info: TFileInfo;
|
|
|
Dir: TPas2jsCachedDirectory;
|
|
|
begin
|
|
|
- Dir:=GetDirectory(Filename,true,false);
|
|
|
- if Dir<>nil then
|
|
|
- Result:=Dir.Count>0
|
|
|
+ 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
|
|
|
- Filename:=ChompPathDelim(ResolveDots(Filename));
|
|
|
- if not FilenameIsAbsolute(Filename) then
|
|
|
- Filename:=WorkingDirectory+Filename;
|
|
|
- Result:={$IFDEF pas2js}NodeJSFS{$ELSE}SysUtils{$ENDIF}.DirectoryExists(Filename);
|
|
|
+ Dir:=GetDirectory(Filename,true,false);
|
|
|
+ if Dir<>nil then
|
|
|
+ Result:=Dir.Count>0
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ Filename:=ChompPathDelim(ResolveDots(Filename));
|
|
|
+ if not FilenameIsAbsolute(Filename) then
|
|
|
+ Filename:=WorkingDirectory+Filename;
|
|
|
+ Result:={$IFDEF pas2js}NodeJSFS{$ELSE}SysUtils{$ENDIF}.DirectoryExists(Filename);
|
|
|
+ end;
|
|
|
end;
|
|
|
end;
|
|
|
|