comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: What about a glob standard method in Ada.Command_Line ?
Date: Tue, 24 Aug 2010 19:10:14 +0200
Date: 2010-08-24T19:10:14+02:00	[thread overview]
Message-ID: <4c73fcf6$0$6992$9b4e6d93@newsspool4.arcor-online.net> (raw)
In-Reply-To: <cgcipmczsqwm.ppd1a9aky2z5.dlg@40tude.net>

On 24.08.10 18:04, Dmitry A. Kazakov wrote:
> 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.

Efficiency of glob is unpredictable.  Linear scans of a directory
are slightly different in this regard [*].
And yes, both the Pattern parameter in current Directories.Start_Search,
or Matcher above could really be dropped. Not much will be lost, if
selecting file names can be performed later.


>> 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? 

No. I look at file names when I scan a directory.


> Those
> are called *content type*. Whether the content type is reflected by the
> file path and in which form is OS-dependent.

Is there an OS that reflects a file's content in its path?


> Patterns cannot work here.

Patterns are intended for names, not content.

(It is odd that most contemporary file systems and archive formats
support extended attributes, but still everyone will keep using files
as if fopen() is the only means of finding information about a file...)


>> Case-(in)sensitivity is easily handled by text pattern matching,
>> with existing Ada.
> 
> It cannot be handled.

Sure can, for file names.
But whether the names "Readme" and "README" refer to two different
files in a directory is another matter, just like the file
"Frodo.txt" may refer to the same file as "README" and "Readme",
in Unix file systems, NTFS, and others that support inodes with
multiple links.

Directories.Start_Search is not about files, I think.
It is about file names (of certain directory entries).


Georg



  reply	other threads:[~2010-08-24 17:10 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-21  4:47 What about a glob standard method in Ada.Command_Line ? Yannick Duchêne (Hibou57)
2010-08-21  6:41 ` J-P. Rosen
2010-08-21  7:21   ` Yannick Duchêne (Hibou57)
2010-08-21  9:11   ` Pascal Obry
2010-08-22 19:00     ` J-P. Rosen
2010-08-22 19:29       ` Yannick Duchêne (Hibou57)
2010-08-23 23:06       ` Randy Brukardt
2010-08-24  0:02         ` Yannick Duchêne (Hibou57)
2010-08-24  0:24           ` Adam Beneschan
2010-08-24 10:27             ` Georg Bauhaus
2010-08-24 14:24               ` Dmitry A. Kazakov
2010-08-24 15:42                 ` Georg Bauhaus
2010-08-24 16:04                   ` Dmitry A. Kazakov
2010-08-24 17:10                     ` Georg Bauhaus [this message]
2010-08-24 17:24                       ` Georg Bauhaus
2010-08-24 18:42                         ` Yannick Duchêne (Hibou57)
2010-08-24 18:51                           ` Simon Wright
2010-08-24 17:41                       ` Dmitry A. Kazakov
2010-08-24 21:32                         ` Georg Bauhaus
2010-08-25  7:55                           ` Dmitry A. Kazakov
2010-08-25  8:24                             ` Yannick Duchêne (Hibou57)
2010-08-25 20:15                               ` (see below)
2010-08-25 20:39                                 ` Yannick Duchêne (Hibou57)
2010-08-25 21:05                                   ` (see below)
2010-08-25 21:32                                     ` Yannick Duchêne (Hibou57)
2010-08-25  8:57                             ` Georg Bauhaus
2010-08-25  9:28                               ` Dmitry A. Kazakov
2010-08-25 11:09                                 ` Georg Bauhaus
2010-08-25 12:01                                   ` Dmitry A. Kazakov
2010-08-25 13:09                                     ` Georg Bauhaus
2010-08-25 13:30                                       ` Dmitry A. Kazakov
2010-08-25 14:20                                         ` Georg Bauhaus
2010-08-25 14:56                                           ` Dmitry A. Kazakov
2010-08-25 15:51                                             ` Georg Bauhaus
2010-08-25 16:46                                               ` Dmitry A. Kazakov
2010-08-25 18:44                                                 ` Georg Bauhaus
2010-08-25 19:39                                                   ` Dmitry A. Kazakov
2010-08-26  0:59                                                     ` Georg Bauhaus
2010-08-26  8:49                                                       ` Dmitry A. Kazakov
2010-09-02 19:25                                                         ` Randy Brukardt
2010-09-02 20:47                                                           ` Dmitry A. Kazakov
2010-09-02 19:08                                                       ` Randy Brukardt
2010-09-02 20:48                                                         ` Georg Bauhaus
2010-08-22 19:30     ` Yannick Duchêne (Hibou57)
2010-08-22 19:46       ` Dmitry A. Kazakov
2010-08-25 13:09 ` anon
2010-08-25 13:13   ` Georg Bauhaus
2010-08-25 13:28     ` J-P. Rosen
2010-08-25 20:29       ` Yannick Duchêne (Hibou57)
2010-08-25 14:14     ` Jeffrey Carter
2010-08-25 21:37     ` anon
2010-08-26  8:21       ` J-P. Rosen
2010-08-26 16:29         ` anon
2010-08-26 20:34           ` Yannick Duchêne (Hibou57)
2010-08-27  4:40             ` Yannick Duchêne (Hibou57)
2010-08-27 12:10           ` J-P. Rosen
2010-09-01  8:08             ` Ada compilers and Ada 2005 (was: What about a glob standard method in Ada.Command_Line ?) Georg Bauhaus
2010-09-01  9:45               ` Ada compilers and Ada 2005 Pascal Obry
2010-09-01 10:28                 ` J-P. Rosen
2010-09-02 19:37                   ` Randy Brukardt
replies disabled

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