with Ada.Text_IO;
with Ada.Directories;
procedure aDir is
package IO renames Ada.Text_IO;
package D renames Ada.Directories;
begin
IO.Put ("Starting default directory: ");
IO.Put_Line (Item => D.Current_Directory);
IO.Put_Line (Item => D.Base_Name (Name => "foo.txt"));
IO.Put_Line (Item => D.Base_Name (Name => ".secret"));
IO.Put_Line (Item => D.Base_Name (Name => ".secret.conf"));
IO.Put_Line (Item => D.Base_Name (Name => "foo/bar"));
IO.Put_Line (Item => D.Base_Name (Name => "/home/thomas/stuff.conf"));
IO.Put_Line (Item => D.Base_Name (Name => ""));
-- Malformed Name parameter
exception
when D.Name_Error =>
IO.Put_Line (Item => "Name_Error raised. Malformed Name.");
end aDir;
Go back