comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Interpretation of extensions different from Unix/Linux?
Date: Wed, 19 Aug 2009 17:40:06 -0500
Date: 2009-08-19T17:40:06-05:00	[thread overview]
Message-ID: <h6hv2c$v4d$1@munin.nbi.dk> (raw)
In-Reply-To: tww2guh98m4j.vbxz4nv412g1.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:tww2guh98m4j.vbxz4nv412g1.dlg@40tude.net...
> On Tue, 18 Aug 2009 15:37:39 -0500, Randy Brukardt wrote:
...
>> I think that would be prohibitively expensive in both time and space.
>
> Absolutely not. Again, Wide_Wide_String is not an implementation of
> UTF8_String, it is merely an interface. The implementation of UTF8_String
> stays an array of octets. Except for indexing which is rarely used with
> UTF8_String other operations of Wide_Wide_String can be delegated to the
> representation's operations. No overhead.

Indexing (and slicing) are pretty much the *only* operations that you do on 
a String. If they are very expensive, the entire implementation will be very 
expensive (especially as operations like "&" are already very expensive).

 ...
>> Windows surely does recognize UNC names natively - surely the file open
>> does. So by your definition these are "true" roots. There of course is a 
>> lot
>> of crappy software out there that doesn't allow them,
>
> It is not crappy, it is backward compatible. All this software uses 
> *legal*
> Windows API, and it is the API functions (16-bit or whatever) which fail 
> to
> handle fake \\nodes, useless stuff like "My Documents", "Desktop" etc. 
> This
> rubbish has nothing to do with the file system. It could be supported, no
> question, but no portable program will probably ever use it. So why should
> we care?

I have no idea what you are talking about. Every 32-bit API supports UNC 
names, and always has (at least as far back as Windows 95). I suppose there 
might be some pre-1995 programs out there that can't support such names 
because of API limitations, but what does that have to do with Ada? All of 
the Ada compilers out there for Windows are 32-bit (or more).

In any case, all of my programs are intended to be portable (to other 
compilers and to other Windows and Windows-like systems), and surely *I* 
depend a lot on UNC names (it's a heck of a lot easier to use them for file 
sharing than to create your own TCP-IP protocol!).

>> but what does that
>> have to do with Ada?? Software that supports text file names but doesn't
>> support UNC names is broken, IMHO.
>
> Nope. The design rule I propose is, any local file has to be accessible
> through at least one root determinable by Ada.Directories. The rest is up
> to the implementor's good will. This is certainly doable in any operating
> system I know.

What is a "local file"? Disk-based names are obsolete for most purposes 
(most of the devices on my latest computer don't have them), so you are 
essentially claiming that you don't want to access anything other than the 
local hard disk.

In any case, if an implementation supports UNC names (and Janus/Ada surely 
does, in *all* operations), it has to treat them as roots. And that means 
that Ada.Directories has to treat them as roots.

The fact that you and I don't even seem to agree what a root is just shows 
how silly it is to even consider trying to do this sort of stuff portably.

...
>>> Sorry, but writing a file browser is not stupid. Consider implementation
>>> of a GUI open-file dialog using Ada.Directories.
>>
>> That is *exactly* what I mean. Any "proper" Windows program will use the
>> built-in file browser, not create some less-powerful version on their 
>> own.
>
> No. First there are two (maybe three) of them under Windows. Both
> (especially the newer one) are quite unusable. The older was extensible so
> that you could add buttons and other stuff *required* by a "proper"
> applications like mine. (:-)) Under Linux the situation is much worse than
> that. So I have my own set of file selection widgets, BTW, docked widgets,
> not dialog boxes.

Barf. When you do that, you lose the capabilities that are specific to the 
particular OS, such as direct access to file shares. And they end up looking 
different than they ought to on a particular target.

In any case, both of the Windows file dialogs are extensible; I know because 
I've done it, both to test Claw and to add checkout buttons to the GUI for 
our version control front-end. It's actually pretty easy to do with Claw.

...
>> That's going to be ambiguous if you have proper string literals and very
>> hard to use if you don't.
>
> It will not:
>
>   Open (File, In_File, "C:", ("temp", "tests"), "test20", "txt");
>
> instead of
>
>   Open (File, In_File, "C:\temp\tests\test20.txt");

That's hard to use in my book. (Besides, I have no idea what you intended it 
to mean other than the Rosetta Stone-like example. It's just not readable or 
understandable.) When you get a user-provided file name (a full path like 
"\\Gatekeeper\Webroot\AdaIC\index.html", which is what you're going to get 
back from a Windows file dialog box or from a simple string entry field), 
you're going to have to parse it to get to a form like the one you are 
suggesting. And then the program will have to put it back together -- just 
adding opportunities to introduce bugs and do something other than the 
user's intent.

If you simplify it and provide an appropriate string literal converter, you 
again have the ambiguity problem (or lots of wordy junky conversions).

                                               Randy.





  parent reply	other threads:[~2009-08-19 22:40 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-01 17:53 Interpretation of extensions different from Unix/Linux? vlc
2009-08-02 17:13 ` Jacob Sparre Andersen
2009-08-04 11:31   ` vlc
2009-08-04 11:44     ` Jacob Sparre Andersen
2009-08-04 11:57       ` Georg Bauhaus
2009-08-04 12:29         ` vlc
2009-08-04 13:43         ` Dmitry A. Kazakov
2009-08-14  4:33           ` Randy Brukardt
2009-08-14  7:37             ` Dmitry A. Kazakov
2009-08-04 12:25       ` vlc
2009-08-04 19:18         ` Jeffrey R. Carter
2009-08-04 19:52           ` Dmitry A. Kazakov
2009-08-04 20:45             ` Jeffrey R. Carter
2009-08-04 21:22               ` Dmitry A. Kazakov
2009-08-04 22:04                 ` Jeffrey R. Carter
2009-08-05  8:33                   ` Dmitry A. Kazakov
2009-08-05 16:07                     ` Jeffrey R. Carter
2009-08-05 16:35                       ` Dmitry A. Kazakov
2009-08-05 17:49                         ` Jeffrey R. Carter
2009-08-05 18:16                           ` Dmitry A. Kazakov
2009-08-05 19:27                             ` Jeffrey R. Carter
2009-08-05 19:50                               ` Dmitry A. Kazakov
2009-08-05 20:46                                 ` Jeffrey R. Carter
2009-08-06  7:43                                   ` Dmitry A. Kazakov
2009-08-05 21:33                               ` Robert A Duff
2009-08-05 19:45                           ` vlc
2009-08-05 19:56                             ` Dmitry A. Kazakov
2009-08-14  4:56                     ` Randy Brukardt
2009-08-14  8:01                       ` Dmitry A. Kazakov
2009-08-14 23:02                         ` Adam Beneschan
2009-08-14 23:54                         ` Randy Brukardt
2009-08-15  8:10                           ` Dmitry A. Kazakov
2009-08-15 12:49                             ` Pascal Obry
2009-08-15 13:23                               ` Dmitry A. Kazakov
2009-08-15 15:11                                 ` Pascal Obry
2009-08-15 17:11                                   ` Dmitry A. Kazakov
2009-08-15 20:07                                     ` Pascal Obry
2009-08-16  7:26                                       ` Dmitry A. Kazakov
2009-08-17 22:28                             ` Randy Brukardt
2009-08-18  0:32                               ` Adam Beneschan
2009-08-18 20:48                                 ` Randy Brukardt
2009-08-19  4:08                                   ` stefan-lucks
2009-08-19 22:01                                     ` Randy Brukardt
2009-08-19  7:37                                   ` Jean-Pierre Rosen
2009-08-19 16:10                                   ` Adam Beneschan
2009-08-19 22:11                                     ` Randy Brukardt
2009-08-18  7:48                               ` Dmitry A. Kazakov
2009-08-18 20:37                                 ` Randy Brukardt
2009-08-19  8:04                                   ` Dmitry A. Kazakov
2009-08-19 10:32                                     ` Georg Bauhaus
2009-08-19 12:11                                       ` Dmitry A. Kazakov
2009-08-19 15:21                                         ` Georg Bauhaus
2009-08-19 22:40                                     ` Randy Brukardt [this message]
2009-08-20  8:00                                       ` Variable- and fixed-length-character strings (Was: Interpretation of extensions different from Unix/Linux?) Jacob Sparre Andersen
2009-08-20 19:40                                       ` Interpretation of extensions different from Unix/Linux? Dmitry A. Kazakov
2009-08-21  0:08                                         ` Randy Brukardt
2009-08-21  7:43                                           ` Dmitry A. Kazakov
2009-08-21 22:10                                             ` Randy Brukardt
2009-08-22  7:27                                               ` Dmitry A. Kazakov
2009-09-01  1:50                                                 ` Randy Brukardt
2009-09-01  7:28                                                   ` Dmitry A. Kazakov
2009-09-02  3:41                                                     ` Stephen Leake
2009-09-02  7:17                                                       ` Dmitry A. Kazakov
2009-09-02 19:49                                                         ` tmoran
2009-09-03  7:41                                                           ` Dmitry A. Kazakov
2009-09-03 17:27                                                             ` tmoran
2009-09-03 20:44                                                               ` Dmitry A. Kazakov
2009-09-03 22:22                                                                 ` Randy Brukardt
2009-09-04  7:40                                                                   ` Dmitry A. Kazakov
2009-09-05  1:58                                                                     ` Randy Brukardt
2009-09-05  2:08                                                                     ` Randy Brukardt
2009-09-05  8:59                                                                       ` Dmitry A. Kazakov
2009-08-21 10:11                                           ` Enumeration of network shared under Windows (was: Interpretation of extensions different from Unix/Linux?) Dmitry A. Kazakov
2009-08-15 16:01                           ` Interpretation of extensions different from Unix/Linux? Vadim Godunko
2009-08-16 13:13                           ` Stephen Leake
2009-08-14  4:46                 ` Randy Brukardt
2009-08-14  9:00                   ` Dmitry A. Kazakov
2009-08-04 21:19           ` vlc
2009-08-14  5:19     ` Randy Brukardt
2009-08-14  6:13       ` Wilcards in Linux (was: Interpretation of extensions different from Unix/Linux?) stefan-lucks
2009-08-14  6:24         ` stefan-lucks
2009-08-14 10:05         ` Wilcards in Linux Markus Schoepflin
2009-08-14 10:22           ` Ludovic Brenta
2009-08-14 18:20             ` Tero Koskinen
2009-08-19 20:39       ` Interpretation of extensions different from Unix/Linux? Keith Thompson
2009-08-19 22:09         ` Robert A Duff
2009-08-20  7:49           ` Jacob Sparre Andersen
2009-08-20 15:56             ` Adam Beneschan
2009-08-20 21:58               ` sjw
2009-08-20 19:44             ` Robert A Duff
2009-08-20 21:34               ` Adam Beneschan
2009-08-20 22:03                 ` (see below)
2009-08-21  0:55                 ` tmoran
2009-08-20 23:55               ` Randy Brukardt
2009-08-21 17:58               ` Keith Thompson
2009-08-21 18:34                 ` Dmitry A. Kazakov
2009-08-21 19:32                 ` Jeffrey R. Carter
2009-08-21 21:34                 ` Robert A Duff
2009-08-21 22:06                   ` Hyman Rosen
2009-08-24 19:51                   ` Keith Thompson
2009-08-28  0:27                     ` Robert A Duff
2009-08-28 13:15                       ` Anders Wirzenius
2009-08-28 15:02                         ` Robert A Duff
2009-08-21  8:45             ` Stephen Leake
replies disabled

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