[lkml]   [2004]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: file as a directory
    On Friday 26 November 2004 19:19, Hans Reiser wrote:
    > For the case Peter cites, yes, it does add clutter to the pathname to
    > say "..metas" (actually, it is "...." now in the current reiser4, not
    > "..metas"). This is because you aren't looking for metafile
    > information, you are looking for a subset and describing the subset, and
    > that just requires a file-directory plugin that can handle the name of
    > that subset and parse the file to find it.

    Regarding namespace unification + XPath:
    For files: cat /etc/passwd/[. = "joe"] should work like in XPath.
    But what to do with directories?
    Would 'cat /etc/[. = "passwd"]' output the contents of the passwd file
    or does it mean to output the file '[. = "passwd"]'?
    If the first is the case then you have to prohibit filenames looking
    like '[foo bar]'.

    If the shells wouldn't like * for themself, I'd suggest something like
    cat /etc/*[. = "passwd"]
    This means: list all contents and show the ones where filename = "passwd".

    For the contents of /etc/passwd the following could become possible:
    'cat /etc/passwd/*[. = "joe"]
    'cat /etc/passwd/*[@shell = "/bin/tcsh"]
    The XPath could behave similiar as if applied to the following XML:
    <root passwd="x" shell="/bin/sh" .... />
    <joe passwd="x" shell="/bin/tcsh" uid="500" gid="500" .... />
    The output from the cat's above return the line of joe's entry:

    To change all tcsh entries to bash:
    echo -n "/bin/bash" > /etc/passwd/*[@shell = "/bin/tcsh"]/@shell

    I hope I'm not offending, but my impression is now that
    XPath stuff fits better into some shell providing
    a XPath view of the filesystem, than into the kernel.


    What about mapping the contents of files into "pure" posix namespace?
    XML is basically a tree, too.
    1) "...." below is the entry to reiser4 namespace.
    2) # denotes a shell command
    For example:

    # cd /etc/passwd/
    # ls -a *
    . .. .... joe root
    # cd joe
    # ls
    gid home passwd shell uid
    # cat shell
    # cd ../....
    # ls

    I guess an implementation in reiser4 would require some
    mime-type/file extension dispatcher plus a special
    directory plugin for each mime-type.

    lg, Chris

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:08    [W:0.022 / U:20.508 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site