* Aristotle Pagaltzis ([EMAIL PROTECTED]) [081204 14:38]:
> Furthermore, from the point of view of the OS, even treating file
> names as opaque binary blobs is actually fine! Programs don’t
> care after all. In fact, no problem shows up until the point
> where you try to show filenames to a user; that is when the
> headaches start, not any sooner.

So, they start when
  - you have users pick filenames (with Tk) for a graphical
    applications. You have to know the right codeset to be able
    to display them correctly.
  - you have XML-files with meta-data on files which are
    being distributed.  (I have a lot of those)
  - when you start doing path manipulation on (UTF-16) "blob"s,
and so forth.  I have been fighting these problems for a long
time, and they worry me more and more because we see Unicode being
introduced on the OS-level.  The mess is growing by the day.

> To that, the right solution is simply nt to roundtrip filenames
> through the user interface; instead, keep both the original octet
> sequence as well as the decoded version, and use the decoded
> version in UI but refer back to the pristine original when the
> user elects, via UI, to operate on that file.

But now you simply say "decode it".  But to be able to decode
it, you must known in which charset it is in the first place.
So: where do we start guessing?  An educated guess at OS level,
or on each user program again?

> decoding issues. The higher-level problems like sorting names in
> a locale-aware fashion will be solved by the CPAN collective much
> better than any boil-the-ocean abstract interface design that the
> Perl 6 cabal would produce – if indeed these are real problems at
> all in practice.

Why?  Are CPAN programmers smarter than Perl6 Cabal people?

What I whould like to be designed is an object model for OS, processes
directories, and files.  We will not be able to solve all problems for
each OS.  Maybe people need to install additional CPAN modules to get
smarter behavior.  But I would really welcome it if platform independent
coding is the default behavior, without need for File::Spec, Class::Path
and such.  Once, we have made the step from FILEHANDLES to IO::File.
Let's make it go a little further.

The discussion is stuck in "filenames", which are a problematic area.
But we started with chown and friends.   It really would like to
be able to write:

   $file = File.new($filename);
   if $file.owner eq $user {}

   {   chown $filename, $user;
       if((stat $filename)[4]==getpwuid $user) {}
   {   die "Sorry, do not understand your system";



       Mark Overmeer MSc                                MARKOV Solutions
       [EMAIL PROTECTED]                          [EMAIL PROTECTED]
http://Mark.Overmeer.net                   http://solutions.overmeer.net

Reply via email to