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.1 required=5.0 tests=BAYES_00,REPLYTO_WITHOUT_TO_CC, UNCLOSED_BRACKET autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6bf1c4b845bd2160 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: What about a glob standard method in Ada.Command_Line ? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4c6f9837$0$5420$ba4acef3@reader.news.orange.fr> <4c739e76$0$6992$9b4e6d93@newsspool4.arcor-online.net> <152a2z5en4z2o$.xjsuqr7s8yak$.dlg@40tude.net> <4c73e859$0$6991$9b4e6d93@newsspool4.arcor-online.net> Date: Tue, 24 Aug 2010 18:04:57 +0200 Message-ID: NNTP-Posting-Date: 24 Aug 2010 18:04:56 CEST NNTP-Posting-Host: c5a3f6f3.newsspool1.arcor-online.net X-Trace: DXC=ofPX`9N\<62gP]QSEBQ^d4ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2ZYUBk^8eT;9[6LHn;2LCV>[ On Tue, 24 Aug 2010 17:42:17 +0200, Georg Bauhaus wrote: > On 24.08.10 16:24, Dmitry A. Kazakov wrote: >> On Tue, 24 Aug 2010 12:27:01 +0200, Georg Bauhaus wrote: >>> >>> procedure Start_Search >>> (Search : in out Search_Type; >>> Directory : in String; >>> Matcher : access function (Pattern : Pattern_Type) return Boolean; >>> Filter : in Filter_Type := (others => True)); >>> >> You just do not need patterns in directory search. The first reason is that >> the underlying OS does not support that arbitrary stuff anyway. > > It is my program that matches file names against a pattern, not the OS. Right, this is why an argument to efficiency would be invalid. You filter entries as you wish, no pattern or filter is needed as you get all entries anyway. Do with them what you want. >> Another, >> more important reason is that real-life search would use filters based many >> criteria, e.g. content, and patterns beyond the scope of RE, especially >> when neither the name encoding nor case-sensitivity specified. > > To me, directory search based on file content ("second order search") > seems rather unusual as a first step. Surely it is. Don't you look for text files, ada source files etc? Those are called *content type*. Whether the content type is reflected by the file path and in which form is OS-dependent. Patterns cannot work here. > Case-(in)sensitivity is easily handled by text pattern matching, > with existing Ada. It cannot be handled. You don't even know if two file names are equivalent using Ada.Directories, how then do you want to do this with pattern matching? That is OS-dependent. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de