[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DogCows or Polymorphism in the Hurd

From: Ivan Shmakov
Subject: Re: DogCows or Polymorphism in the Hurd
Date: Mon, 13 Feb 2006 22:06:53 +0600

>>>>> "MB" == Marcus Brinkmann <address@hidden> writes:


 MB> You _can_ build a shell in which you can do the above.  In
 MB> implementing this patrick-shell, you will find that you have to
 MB> compromise _something_.  In the same way that you have to
 MB> compromise something if implementing similar functionality in a
 MB> graphical shell like a file browser.  For example, your
 MB> introduction of a "::" special character is a compromise.

 MB> This is not a bad thing per se.  It's just a consequence of what
 MB> POSIX says about files and directories, and how Unix implements
 MB> them traditionally (which has a consequence on how applications
 MB> interpret POSIX).

        Actually, the DogCows problem exists in POSIX as well.  Consider
        the following example:

$ ls -l foo/
total 0
-rw-r--r--    1 ivan     users           0 Feb 13 21:40 bar
-rw-r--r--    1 ivan     users           0 Feb 13 21:40 baz

        Is the foo/ a directory?  Of course it might be, but it's not
        the case:

$ ls -l foo
lrwxrwxrwx    1 ivan     users           3 Feb 13 21:41 foo -> qux

        In this example, `foo' acts as both the symbolic link and the
        directory at the same time.  The commands distinguish between
        them (if there's a need to) by interpreting the trailing slash
        as a request to dereference the symbolic link to the directory.

        Please note that the problem was solved by introduction of yet
        another meaning for an already reserved slash character.  Of
        course, overusing the slash isn't probably a very good idea, but
        it could be a practical solution for the simple cases.

        Furthermore, POSIX addresses this problem not only at the
        ``shell level'', but at the level of the C Library as well (stat
        () vs. lstat ()).  BTW, as long as the POSIX is ``emulated'' (as
        opposed to ``implemented'') by the HURD, the particular case of
        FileDir problem could probably be addressed by turning every
        such FileDir into a symbolic link.  This way, POSIX applications
        won't probably get very confused.

        Introduction of yet another special character (or a string) seem
        to me like a bad idea.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]