[fpc-pascal] Is there a FindAllDirs command like FindAllFiles?

Bo Berglund bo.berglund at gmail.com
Sat Jul 25 00:08:01 CEST 2020


I am using FindAllFiles() in order to enumerate the files of a certain
name pattern in a FPC application on Linux.
I am using Fpc 3.0.4 and Lazarus 2.0.8.

FindAllFiles() has a switch to search the files in subdirectories and
this works fine.

But I would like to enumerate the subdirectories themselves (without
the content). Is there a hidden switch for this or is there a command
to enumerate only the directories of a certain path?
Maybe a way to specify the SearchMask such that it only finds
directories?

According to the FPC wiki FindAllFiles() last argument DirAttr is set
by default to faDirectory, but there is no discussion in the article
on how it can be set to something else and what will be the result in
such a case.

-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list