Welcome, Guest
Username: Password: Remember me
General Purpose Components and Libraries, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

FindAllDirectories return wrong value? 8 years 6 days ago #9444

  • Bronislav Miksha
  • Bronislav Miksha's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Hello!
I have problem with obtaining a list of directories in directories begin with dot.

In Delphi TDirectory.GetDirectories('d:\test','*',TSearchOption(1)) return:

d:\test\.DotDir
d:\test\.DotDir\dir
d:\test\.DotDir\dir1
d:\test\.DotDir\dir1\dir2
d:\test\.DotDir\dir1\dir2\dir3

d:\test\Dir
d:\test\Dir\Dir4
d:\test\Dir\dir5

In Typon FindAllDirectories('d:\test',True); return:

d:\test\.DotDir
d:\test\Dir
d:\test\.DotDir\dir
d:\test\.DotDir\dir1
d:\test\Dir\Dir4
d:\test\Dir\dir5

Typhon 5.8 r52101 FPC 3.1.1 x86_64-win64-win32/win64

Please Log in or Create an account to join the conversation.

Last edit: by Bronislav Miksha.

FindAllDirectories return wrong value? 8 years 5 days ago #9445

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Thanks Sir
Did you test Lab CT ver 5.8 Revision 005720 ?
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

FindAllDirectories return wrong value? 8 years 5 days ago #9450

  • Bronislav Miksha
  • Bronislav Miksha's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Thanks for the support! Unfortunately it did not help. Attached my test project.

Please Log in or Create an account to join the conversation.

FindAllDirectories return wrong value? 8 years 5 days ago #9451

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Sir
we test your project
-pic1 Typhon32
-pic2 Typhon64

Windows 10 Pro 64bits
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

FindAllDirectories return wrong value? 8 years 5 days ago #9453

  • Bronislav Miksha
  • Bronislav Miksha's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Thanks for the support! I think found the reason. I copied the folders from a Linux system. And there is a folder beginning with a dot are considered hidden mark. If you set the flag "Hidden" is a problem. I recorded a little video with this problem.

Please Log in or Create an account to join the conversation.

FindAllDirectories return wrong value? 7 years 11 months ago #9531

  • Bronislav Miksha
  • Bronislav Miksha's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
Hello sir!
My solution in analogy with findallfiles:
In fileutil.pas edit
function FindAllDirectories(const SearchPath: string;
  SearchSubDirs: Boolean = True; DirAttr:DWord = faDirectory): TStringList; overload;
procedure FindAllDirectories(AList: TStrings; const SearchPath: String;
  SearchSubDirs: Boolean = True ; DirAttr:DWord = faDirectory); overload;
In fileutil.inc after
Searcher := TListDirectoriesSearcher.Create(AList);
add
Searcher.DirectoryAttribute := DirAttr;

example
DirectoriesList:=FindAllDirectories(TestDir,True,(faDirectory or faHidden));

Could you check out this solution and if it is valid to add it by default in fileutil?

Please Log in or Create an account to join the conversation.

  • Page:
  • 1