Provides a canonical iterator that will process each directory entry
found within a directory. The processing may be stopped by the users
call-back routine.
Example 1: Find all ".ads" files on drive "C"
declare
use Ada;
procedure Put_Line (Item : Directories.Directory_Entry_Type;
Quit : in out Boolean) is
begin
Put_Line ("+++ Found file: " & Directories.Simple_Name (Item));
end Put_Line;
procedure Find is
new Directories.Searches.Generic_Find (Put_Line);
begin
Find (Name => "*",
Directory => "C:\",
Extension => "ads",
Recursive => True);
end;
Example 2: Find all files on drive "C"
declare
use Ada;
procedure Put_Line (Item : Directories.Directory_Entry_Type;
Quit : in out Boolean) is
begin
Put_Line ("+++ Found file: " & Directories.Simple_Name (Item));
end Put_Line;
procedure Find is
new Directories.Searches.Generic_Find (Put_Line);
begin
Find (Name => "*",
Directory => "C:\",
Extension => "",
Recursive => True);
end;
Example 3: Find all files with an extension on drive "C"
declare
use Ada;
procedure Put_Line (Item : Directories.Directory_Entry_Type;
Quit : in out Boolean) is
begin
Put_Line ("+++ Found file: " & Directories.Simple_Name (Item));
end Put_Line;
procedure Find is
new Directories.Searches.Generic_Find (Put_Line);
begin
Find (Name => "*",
Directory => "C:\",
Extension => "*",
Recursive => True);
end;