comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Directories and network shares
@ 2010-07-17 10:43 Dmitry A. Kazakov
  2010-08-16 19:16 ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry A. Kazakov @ 2010-07-17 10:43 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-16 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-17 10:43 Ada.Directories and network shares Dmitry A. Kazakov
2010-08-16 19:16 ` Yannick Duchêne (Hibou57)
2010-08-16 19:31   ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox