Messages in this thread | | | Date | Sun, 20 Jun 1999 20:00:16 +0000 (/etc/localtime) | From | root <> | Subject | I discussed reading directories as files with jra, Stallman, and loic |
| |
It was two separate conversations, but they both go together. I ask that they correct me if I unfairly summarize their words.
Jeremy wants in the FS what he can get with Microsoft streams and Macintosh forks. That is, he wants to be able to name an object, and read it, and get something, and he wants to be able to add something that goes into that object, and stays with it when the object gets moved. He wants this because he is a Samba author, and it will make his life a lot easier to have it when Windows 2000 comes out.
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. That is, inside the directory there is one file that when you open (dirname) you get a file descriptor pointing to dirname/default. Now please note that dirname/default can be a symlink, a hard link (presumably to a file within the same directory), it can be all sorts of things. It can also be called something like "....", or even "". I have to think some about which I like.
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.
Finally, you need a new file type flag indicating that it is both a file and a directory.
Now let's skip ahead to my conversation with rms and loic@ceic.com which came after talking with Jeremy..
This time we discussed how you might read and edit the contents of a directory as an aggregation within one buffer. The examples were editing /etc/passwd and /etc/services within emacs, with passwd and services converted into directories. Imagine that passwd is converted into a directory, with each line being a separate file, and each file (line) having a separate modification time. Clearly something useful. Reading it is easy, you have a read on the directory return the concatenation of the files.
How do you edit it?
Proposed answer: have the concatenation contain separators. rdf (not rich document format, but some XML replacement also called rdf) was suggested by Loic@ceic.com as the standard for the separators. I don't know anything about rdf, but I am willing to believe it might work for this since loic@ceic.com thought so. This way emacs needs not a single modification to be able to effectively edit it. (emacs already has a "narrowing" feature....)
How do you order it? It's important for the /etc/services file-directory that it be ordered.
Proposed answer: implement file content inheritance. That is, allow one file to inherit the contents of another file. Then you can implement the dirname/default file as a file which inherits the various members of the directory in a specified order. That file would not need to inherit any of them, it could inherit none of them, in which case it would do what Jeremy needs it to do for Samba.
In summary, implement the following:
* stat data inheritance
* file content inheritance
* resolve open/read(dirname) as open/read(dirname/default)
* 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.
rms is Bcc'd in case he doesn't want a lot of emails.
Thanks to a lot of suggestions, I think this is finally reaching the point where it will be really rather useful.... Comments?
Hans
- 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/
| |