From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ea884956d1f3b172 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!l14g2000pre.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: How do I use GNAT.Directory_Operations.Iteration? Date: Tue, 15 Mar 2011 03:23:22 -0700 (PDT) Organization: http://groups.google.com Message-ID: <28b47ca7-734d-4373-ad49-bfe36e00719d@l14g2000pre.googlegroups.com> References: <1qu5ftcmzm7ib$.1136j6nf4hmwu.dlg@40tude.net> <6aeb51a133df5c661bc550bfb036b6b4@dizum.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1300184603 26972 127.0.0.1 (15 Mar 2011 10:23:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 15 Mar 2011 10:23:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l14g2000pre.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009012111 Red Hat/3.0.6-1.el5 Firefox/3.0.6,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19176 Date: 2011-03-15T03:23:22-07:00 List-Id: Nomen Nescio wrote on comp.lang.ada: > Hi everyone, thanks for your examples. My problem is instantiating the > GNAT.Directory_Operations.Iteration package and all of your answers are > about using Ada.Directories in code, which is not what I am asking about. > > I may use your examples instead of the GNAT package because it would be more > portable, but I would like to understand how to instantiate the GNAT > package. I cannot figure the right syntax. Something like: procedure Do_Something_With (Item : String; Index : Positive; Quit : in out Boolean); -- processes the file named Item. Implementation left to the reader. procedure Do_Something_On_All_Files_Matching is new GNAT.Directory_Operations.Iteration.Find (Action => Do_Something_With); begin Do_Something_On_All_Files_Matching (Root_Directory => "/", File_Pattern => ".*\.ad[bs]"); HTH -- Ludovic Brenta.