comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Ada.Directories and network shares
Date: Sat, 17 Jul 2010 12:43:15 +0200
Date: 2010-07-17T12:43:16+02:00	[thread overview]
Message-ID: <1ba1dga9eoydh.10v0tx3bl9yxw$.dlg@40tude.net> (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



             reply	other threads:[~2010-07-17 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-17 10:43 Dmitry A. Kazakov [this message]
2010-08-16 19:16 ` Ada.Directories and network shares Yannick Duchêne (Hibou57)
2010-08-16 19:31   ` Dmitry A. Kazakov
replies disabled

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