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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ea884956d1f3b172 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: How do I use GNAT.Directory_Operations.Iteration? Date: Tue, 15 Mar 2011 03:45:20 -0700 Organization: Aioe.org NNTP Server Message-ID: References: <1qu5ftcmzm7ib$.1136j6nf4hmwu.dlg@40tude.net> <6aeb51a133df5c661bc550bfb036b6b4@dizum.com> <28b47ca7-734d-4373-ad49-bfe36e00719d@l14g2000pre.googlegroups.com> Reply-To: nma@12000.org NNTP-Posting-Host: tUYQ4Ty9mMw9Pdc8TJRFQA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:18206 Date: 2011-03-15T03:45:20-07:00 List-Id: On 3/15/2011 3:23 AM, Ludovic Brenta wrote: > 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. When I also looked at the documentation for these packages, I could not find any examples on how to use these: http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/rts/g-dirope__ads.htm When I write something myself, I try to always put a small example at the top, as part of it documentation, of how to call or use it. It would be nice if these had such examples. --Nasser