#1 2020-08-01 00:24:03

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 107
Website

[Fixed] FindFiles sub-folders search is failed under Windows

Hi, all sub-folders search in FindFiled are failed under Windows.

The bug is in SynCommons.pas SearchRecValidFolder function:

function SearchRecValidFolder(const F: TSearchRec): boolean;
begin
  result := (F.Attr and (faDirectory {$ifdef MSWINDOWS}and faHidden{$endif})=faDirectory) and
    (F.Name<>'') and (F.Name<>'.') and (F.Name<>'..');
end;

Due to faDirectory = 16 and faHidden = 2 we have faDirectory and faHidden = 0 under Windows and all sub-folders are skipper from the search.

Please merge the fix: https://github.com/synopse/mORMot/pull/336

Last edited by Eugene Ilyin (2020-08-01 20:40:20)

Offline

#2 2020-08-01 08:01:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,474
Website

Re: [Fixed] FindFiles sub-folders search is failed under Windows

I have merged the fix.

Note that mORMot2 fork was correct about this. smile

Thanks for the feedback!

Offline

#3 2020-08-01 20:39:51

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 107
Website

Re: [Fixed] FindFiles sub-folders search is failed under Windows

Thanks

Offline

Board footer

Powered by FluxBB