lkml.org 
[lkml]   [1999]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: I discussed reading directories as files with jra, Stallman, and loic
    Date
    root <reiser@ceic.com> writes:
    > I convinced him that directories can do this, and do it cleaner than
    > that MS crud they use as an FS model. The directories need a few
    > features added though.
    >
    > First, they need to be able to have a file that when you read them they
    > resolve to.

    Why not just do it this way..:

    int do_open(char *name, int flags) {
    int res = open(name, flags);
    if(res == -1 && errno == EISDIR) {
    char defname[strlen(name)+9];
    sprintf(defname, "%s/default", name);
    res = open(defname, flags);
    }
    return res;
    }


    > Next files need to be able to inherit stat data, so that a file can
    > share its modification time with its parent directory, so that modifying
    > the file changes the mod time on the directory.
    >
    Hmmm... why does the directory need a modification time at all, then? Just
    stat the file first (reverse code than above, check for ENODIR).

    > * implement a write which when done to a file with an inheritance flag
    > set on it will look for and parse an rdf style syntax to determine how
    > to perform the write.
    >
    Ugh, I do think that one should be in a library somewhere.

    In the specific case of /etc/services, which should be ordered but only
    because the first matching entry "wins". /etc/services is a good example
    because I wonder what you'd use as file name in the first place -- the
    service name? The number? Any one of the aliases? IMHO the file doesn't
    really fit the directory lookup paradigm at all. So why try and force it
    into one?

    --
    Matthias Urlichs | noris network GmbH | smurf@noris.de | ICQ: 20193661
    The quote was selected randomly. Really. | http://www.noris.de/~smurf/
    --
    What is the approximate air speed of an unladen swallow ?

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:52    [W:2.122 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site