l4-hurd
[Top][All Lists]
Advanced

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

Re: DogCows or Polymorphism in the Hurd


From: Jonathan S. Shapiro
Subject: Re: DogCows or Polymorphism in the Hurd
Date: Fri, 03 Feb 2006 10:49:42 -0500

On Fri, 2006-02-03 at 09:42 +0100, Tom Bachmann wrote:
> Marcus Brinkmann wrote:
> > (because [grep] treats them as files). 
> 
> Yes. But grep usually doesn't choose the files to examine at all. The 
> user/shell does.

The problem cases are:

        grep something-that-is-DogCow

or

        grep -R anything

> > What would this mean for our tar.gz example?  It would mean that a
> > translator implementing a tar.gz feature would either be seen as a
> > tar.gz file, _or_ as a directory to the root of the archive, but never
> > both with the same object.  In particular, the tar.gz file and the tar
> > root directory would get different names in the directory hierarchy.
> > For example, the tar.gz node could be called "foo.tar.gz" and the
> > archive root dir could be called "foo".
> 
> I guess you mean the logical hierarchy? So that what e.g. ls shows us? 
> Because this poly-type object is still one file, and we do not even have 
> a reliable way to insert the new logical files into the hierarchy.

If we cannot insert files, then the translator either needs to make the
directory appear to be read only or this bug needs to be fixed.

> > Using the poly-type approach would remove all ambiguities: Applications
> > would either see a file or a directory, but not both.  Applications who
> > _know_ about hybrid types can use the new functions to switch facets
> > explicitely.  If a user wants to use an application with a hybrid type,
> > he will have to make his intent explicit by providing the node with the
> > right facet type to the application.
> > 
> 
> What I do not understand is what applications without knowledge of this 
> approach. They would see objects that neither provide directory nor file 
> semantics.

This is not correct. Have a look at my ascii art (assuming it survived;
use a monospace font). In effect, you have a "file" object that has two
new methods:

        queryOtherInterfaces()
        getOtherInterface()

a polytype-unaware program simply ignores these and behaves as it does
now.


shap





reply via email to

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