From: anon@att.net
Subject: Re: Why no Ada.Wide_Directories?
Date: Thu, 27 Oct 2011 17:40:30 +0000 (UTC)
Date: 2011-10-27T17:40:30+00:00 [thread overview]
Message-ID: <j8c52c$ouh$1@speranza.aioe.org> (raw)
In-Reply-To: 9937871.172.1318575525468.JavaMail.geo-discussion-forums@prib32
Here is a reason from a link at Unicode.org:
http://www.cl.cam.ac.uk/~mgk25/unicode.html
"...An ASCII or Latin-1 file can be transformed into a UCS-2 file by
simply inserting a 0x00 byte in front of every ASCII byte. If we
want to have a UCS-4 file, we have to insert three 0x00 bytes instead
before every ASCII byte.
Using UCS-2 (or UCS-4) under Unix would lead to very severe problems.
Strings with these encodings can contain as parts of many wide
characters bytes like "\0" or "/" which have a special meaning in
filenames and other C library function parameters. In addition, the
majority of UNIX tools expects ASCII files and cannot read 16-bit
words as characters without major modifications. For these reasons,
UCS-2 is not a suitable external encoding of Unicode in filenames,
text files, environment variables, etc."
So Wide_Character could cause problems in other parts of the OS
or Ada/C libraries. And Ada has does have a "Safety and Security"
concerns. Like paragraph 4 in Annex H.
4 Restricting language constructs whose usage might complicate the
demonstration of program correctness
Plus, the goal of "reliability, maintainability, and efficiency" could
not be keep if Ada_Directory was Wide_Character. Because the storage
of Wide_Character rather 16-bit or 32-bit is not as efficient as 8 bit
for filenames. Just think about the old simple 8 by 3 character file
names. In Wide_Characters that would minimally be 16 by 6 byte (UCS-2)
or even 32 by 12 byte (UCS-4). Which means searching and comparing names
could take 2 to 4 time longer and 2 or 4 time more storage for the name.
Which is less efficiency. A quick note on maintainability, and how many
systems will be using the (16/32) Unicode for their filenames.
So, to be reliability and efficiency, Wide_Characters should be keep
to the routines and data that requires the addition storage to be
accurate, not to files that are already hurt because they are normally
on a slower access media. And causing more time is defeat the purpose
of timely reliability program.
In <9937871.172.1318575525468.JavaMail.geo-discussion-forums@prib32>, Michael Rohan <michael.k.rohan@gmail.com> writes:
>Hi,
>
>I've working a little on accessing files and directories using Ada.Director=
>ies and have been using a thin wrapper layer to convert from Wide_String to=
> UTF8 and back. It does, however, seem strange there is no Wide_Directorie=
>s version in the std library. Was there a technical reason it wasn't inclu=
>ded?
>
>Take care,
>Michael
prev parent reply other threads:[~2011-10-27 17:42 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-14 6:58 Why no Ada.Wide_Directories? Michael Rohan
2011-10-14 7:39 ` Yannick Duchêne (Hibou57)
2011-10-14 9:07 ` Dmitry A. Kazakov
2011-10-14 12:48 ` Yannick Duchêne (Hibou57)
2011-10-14 12:54 ` Yannick Duchêne (Hibou57)
2011-10-15 1:06 ` ytomino
2011-10-15 6:55 ` Vadim Godunko
2011-10-15 12:34 ` ytomino
2011-10-15 8:38 ` Dmitry A. Kazakov
2011-10-15 13:12 ` Peter C. Chapin
2011-10-15 13:22 ` Ludovic Brenta
2011-10-15 14:47 ` Dmitry A. Kazakov
2011-10-16 5:48 ` Yannick Duchêne (Hibou57)
2011-10-17 0:15 ` Peter C. Chapin
2011-10-17 3:23 ` Yannick Duchêne (Hibou57)
2011-10-17 7:12 ` Simon Wright
2011-10-17 7:59 ` Dmitry A. Kazakov
2011-10-18 10:55 ` Peter C. Chapin
2011-10-18 12:27 ` Dmitry A. Kazakov
2011-10-16 5:51 ` Yannick Duchêne (Hibou57)
2011-10-17 21:41 ` Randy Brukardt
2011-10-18 7:29 ` Dmitry A. Kazakov
2011-10-18 14:06 ` Pascal Obry
2011-10-18 14:08 ` Pascal Obry
2011-10-19 21:32 ` Randy Brukardt
2011-10-17 21:33 ` Randy Brukardt
2011-10-17 23:47 ` ytomino
2011-10-18 1:10 ` Adam Beneschan
2011-10-18 2:32 ` ytomino
2011-10-18 4:46 ` ytomino
2011-10-18 9:32 ` Yannick Duchêne (Hibou57)
2011-10-18 10:00 ` Dmitry A. Kazakov
2011-10-18 10:06 ` Yannick Duchêne (Hibou57)
2011-10-18 12:01 ` Dmitry A. Kazakov
2011-10-18 15:02 ` Adam Beneschan
2011-10-18 15:16 ` Dmitry A. Kazakov
2011-10-18 23:42 ` Adam Beneschan
2011-10-19 8:12 ` Dmitry A. Kazakov
2011-10-19 21:43 ` Randy Brukardt
2011-10-20 7:37 ` Dmitry A. Kazakov
2011-10-20 11:04 ` Yannick Duchêne (Hibou57)
2011-10-20 12:21 ` Dmitry A. Kazakov
2011-10-20 12:38 ` Yannick Duchêne (Hibou57)
2011-10-20 14:31 ` Dmitry A. Kazakov
2011-10-20 15:54 ` Yannick Duchêne (Hibou57)
2011-10-20 17:35 ` Dmitry A. Kazakov
2011-10-21 12:53 ` Yannick Duchêne (Hibou57)
2011-10-21 13:41 ` Dmitry A. Kazakov
2011-10-25 19:22 ` Randy Brukardt
2011-10-25 19:35 ` Dmitry A. Kazakov
2011-10-26 22:41 ` Randy Brukardt
2011-10-27 7:43 ` Dmitry A. Kazakov
2011-10-27 15:13 ` Yannick Duchêne (Hibou57)
2011-10-27 19:39 ` Robert A Duff
2011-10-27 21:09 ` Yannick Duchêne (Hibou57)
2011-10-28 7:50 ` Dmitry A. Kazakov
2011-10-28 8:45 ` Yannick Duchêne (Hibou57)
2011-10-28 14:59 ` Dmitry A. Kazakov
2011-10-20 17:40 ` J-P. Rosen
2011-10-20 18:43 ` Dmitry A. Kazakov
2011-10-21 10:07 ` Vadim Godunko
2011-10-21 11:25 ` J-P. Rosen
2011-10-21 12:25 ` Yannick Duchêne (Hibou57)
2011-10-21 13:13 ` Dmitry A. Kazakov
2011-10-21 16:03 ` Yannick Duchêne (Hibou57)
2011-10-21 18:34 ` Dmitry A. Kazakov
2011-10-21 19:30 ` Yannick Duchêne (Hibou57)
2011-10-21 20:02 ` Dmitry A. Kazakov
2011-10-21 20:36 ` Yannick Duchêne (Hibou57)
2011-10-22 7:54 ` Dmitry A. Kazakov
2011-10-22 20:28 ` Yannick Duchêne (Hibou57)
2011-10-22 22:23 ` Yannick Duchêne (Hibou57)
2011-10-23 7:53 ` Dmitry A. Kazakov
2011-10-25 19:16 ` Randy Brukardt
2011-10-21 18:55 ` Vadim Godunko
2011-10-21 19:18 ` J-P. Rosen
2011-10-21 19:41 ` Yannick Duchêne (Hibou57)
2011-10-18 22:54 ` ytomino
2011-10-18 3:15 ` Yannick Duchêne (Hibou57)
2011-10-18 7:55 ` Dmitry A. Kazakov
2011-10-18 9:41 ` Yannick Duchêne (Hibou57)
2011-10-18 10:25 ` J-P. Rosen
2011-10-18 10:56 ` Yannick Duchêne (Hibou57)
2011-10-18 15:34 ` Adam Beneschan
2011-10-18 17:27 ` J-P. Rosen
2011-10-18 18:33 ` Adam Beneschan
2011-10-18 19:54 ` Yannick Duchêne (Hibou57)
2011-10-18 8:01 ` Dmitry A. Kazakov
2011-10-18 2:59 ` Yannick Duchêne (Hibou57)
2011-10-18 4:07 ` Michael Rohan
2011-10-18 4:54 ` ytomino
2011-10-18 9:54 ` Yannick Duchêne (Hibou57)
2011-10-18 10:52 ` ytomino
2011-10-18 11:02 ` Yannick Duchêne (Hibou57)
2011-10-18 21:18 ` ytomino
2011-10-18 10:10 ` J-P. Rosen
2011-10-22 6:32 ` Michael Rohan
2011-10-22 7:25 ` Yannick Duchêne (Hibou57)
2011-10-25 19:26 ` Randy Brukardt
2011-10-27 17:40 ` anon [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox