My own backup program uses it's own class to find all files and all directories and has callbacks to add process what it finds.
Instead of chest thumping, it might be a nice gesture to share at least a small portion of that Search code to help others to actually find **all** files in Linux.
Well, my backup program and all code it uses can be found at
https://svn.code.sf.net/p/flyingsheep/code/trunk/. It's all LGPL, so use, modify as you see fit.
That is why we have the AllFilesMask constant in the system unit.
Well, that is nonsense, the "AllFilesMask" is still only defined as a single Asterisk in System-Unit which does not work any differently.
I was trying to explain that '*.*' is not the appropriate mask for all files on your system.
While this works on Windows, it does not on *nix.
The AllFilesMask is defined per OS and works for that OS, so when you use AllFilesMask your code will be cross platform.
(B.t.w. '*' works on Windows as well, hence AllFilesMask is '*' on Windows as well.)
And of course on your platform AllFilesMask works exactlly like '*', because it is defined as '*' on *nix (because that is the appropriate mask). If you use FindFirst/FindNext with the correct attribute set, then it will report all files and folders.
FindAllFiles by design only returns files, not folders.
If you look at the code of FindAllFiles you can see the engine it uses.
That same engine can be used in a different way to return all files and folders IIRC it has OnFileFound and OnDirectoryFound events that you can use to do what you want.
Bart