I often needed to delete files recursively (of course only those matched given mask), so I create a program to help me doing it (Windows explorer's search is SLOW and the deletion is even SLOWER!). However, the running time is O(2n). Since I need to delete tens of thousands of files, the running time is quite significant.
This can be achieved by a function that iterates over a directory (and possibly its subdirectories) and do specified operation on every files that matches given mask. However, I don't seem to find one. The closest one is FindAllFiles from Lazarus' FileUtil unit + iteration of DeleteFile over the result and that's the one I'm currently using. Would someone add it?
Possible interface:
type
TFileAction = procedure (const FileName: String);
procedure IterateDir(const BasePath,FileMask: String; const Recursive:
Boolean: Action: TFileAction);P.S.: Attachment is the source code of my program. http://www.nabble.com/file/p22655474/Deleter.pas Deleter.pas
