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: Wed, 25 Aug 2010 20:44:17 +0200
Date: 2010-08-25T20:44:17+02:00	[thread overview]
Message-ID: <4c756481$0$6775$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <pctaxa595fij$.ssc5u6r6bbwp$.dlg@40tude.net>

On 25.08.10 18:46, Dmitry A. Kazakov wrote:

>> It is not actually possible to provide a common abstraction
>> for *new* and *existing* file names.  While "broken", the file
>> names do exist.  Just a few examples illustrating a variety of file
>> naming fun:
>>
>> - Names created in NTFS that end in a '.'
>>
>> - Two names in existing ext2 directories that contain
>>  "mutually exclusive" characters (via incompatible encoding)
>>
>> - Names containing characters that are special in Windows but
>>  not in POSIX.
>>
>> - Names with spaces in them
> 
> You don't get the point. See A.13(9)

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));


There is no  "string given for the parameter [Matcher]" that "does
not allow the identification of an external file".
The situation is reversed: The suggested overloaded procedure
Directories.Start_Search (or Search) will RECEIVE a name from the file
system via the run-time system; the name of an existing file; one
that has been identified already.
There is no identification attempt performed by the program.
It acts as if some implementation-defined all-inclusive wildcard
had been passed to Ada's Directories.Start_Search, as the
Pattern : String parameter, and then, later, some callback (Matcher
in the alternative declaration above) checks to see whether the file
identifying file name that it got from the system is fine.


  OS -> file name -> Search -> Matcher (sees file name) -> ...

Not

  file name pattern -> Search -> !! identification

But as if

  "*" -> Search -> Match (file name pattern) -> ...


>> If in the real word, I/O of "broken" integer values is a
>> reality.
> 
> What does this have to do with the point?

I expect file names to be read from the disk, as is, I do not
construct them. Whether they are broken WRT some expectation
or not is like when a program receives a valid or usable representation
or not from an integer location:

  V : Integer_Subtype;
  pramga Import (Ada, V);
  pragma Volatile (V);

As you can see, this is how I consider existing names of existing
files, too.  But I want to be able to look at the bits of V, not
just raise an exception.

> You seem to wish file names checked statically.

No.


>> Almost all WWW documents are broken by your taxonomy.
>> Google is rich...
> 
> I don't understand what you are talking about.

An analogy.
If the WWW, that is, the external environment, has valid
HTML, it is possible to use HTML grammar to describe
HTML. It isn't valid. But we can still try to extract meaningful
information even from syntactically broken pages.
The state of file names may be a little more correct
than an average WWW page.
I want to be able to use both.
How can I do that if the interesting data needs to be
in proper shape to be processed without raising exceptions?
By analogy, how can I process whatever exists in the directory
as file names if these need to be conforming to some scheme?


Georg



  reply	other threads:[~2010-08-25 18:44 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
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 [this message]
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