[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: Tue, 14 Feb 2006 22:42:34 +0600

>>>>> Marcus Brinkmann <address@hidden> writes:

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


 >> 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.


 >> Furthermore, POSIX addresses this problem not only at the ``shell
 >> level'', but at the level of the C Library as well (stat ()
 >> vs. lstat ()).

 > You make a good point.  The introduction of symbolic links, a new
 > type in the filesystem beside files and directories, in Unix had
 > extensive ripple-effects through the interfaces, at the system level
 > as well as at the shell level.  Also, many programs needed to be
 > adapted to deal correctly with the symbolic links.

        But for much more there was no need in any adaptation.
        E. g. there's no sense for `cat' or `fmt' to distinguish between
        symbolic links and the files they're referring to.

        Yet another file type -- a FIFO -- implements an interface very
        close to the File interface (with an exception that one cannot
        seek a FIFO).  FIFOs (as well as symlinks) wouldn't probably be
        as useful, if they were distinguished from regular files by the
        majority of programs.

 > If the introduction of _one_ new type caused such large changes,
 > it's not hard to see how the introduction of an infinite number of
 > possible types can become unmanagable at the POSIX layer.

        So, by use of the POSIX layer implemented by the HURD, the
        program shouldn't probably get access to more interfaces than
        there's in POSIX.  It seems to me really safe to give directory
        interface to an archive (e. g. Tar) file, as well as the file
        interface (which will read raw data).  If one wants to give
        access to more interfaces to the POSIX layer, one should bind
        these interfaces to distinct names, explicitly.  (It seems to me
        that something like this was already suggested in this thread).

 >> 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.

 > Not really, because that's not the semantics you usually want.

        I'm not really suggesting much of the semantics here.  I was
        thinking about `find' and `ls' semantics (with respect to stat
        () and lstat () calls), but I was probably wrong.

reply via email to

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