From: Dmitry A. Kazakov on
It seems that Ada.Directories is broken. Neither under Fedora or Debian the
following can walk a network share (cifs). The following does not work with
mounted shares:

with Ada.Directories; use Ada.Directories;
with Ada.Text_IO;

procedure Test_Directory_Walk is
procedure Walk (Name : String; Pattern : String) is
procedure Print (Item : Directory_Entry_Type) is
begin
Ada.Text_IO.Put_Line (Full_Name (Item));
end Print;
procedure Walk (Item : Directory_Entry_Type) is
begin
if Simple_Name (Item) /= "." and then Simple_Name (Item) /= ".."
then
Walk (Full_Name (Item), Pattern);
end if;
exception
when Name_Error => null;
end Walk;
begin
Search (Name, Pattern, (others => True), Print'Access);
Search (Name, "*", (Directory => True, others => False),
Walk'Access);
end Walk;
begin
Walk (".", "*");
end Test_Directory_Walk;

When starting at the directory containing the mounting point, the result is
that the mounting point is not printed at all. When cd at the mounting
point and starting it there, then the result is:

raised ADA.IO_EXCEPTIONS.NAME_ERROR : unknown directory ""

P.S. GNAT GPL 2010 seem to work, but I have a suspicion that it has some
issues as well. I didn't figured yet when and which.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
 | 
Pages: 1
Prev: S'Is_nan or S'Is_inf?
Next: Dispatching confusion