Note that
if (stat()){
open
read
close
}
is not new code. It's code in ls, 8c, mk, acme, etc. etc. etc.
The point is how to make that code work nicely across bad latency links.
But you do not want to change that code.
Also, there's no overhead if you don't use our stuff while "within the
building".
On 6/23/07, Lucio De Re <[EMAIL PROTECTED]> wrote:
On Sat, 2007-06-23 at 15:36 +0200, Francisco J Ballesteros wrote:
>
> Now, say you have a program that does:
> if (stat(afile)){
> open(afile)
> read(afile)
> close(afile)
> }
>
So those are 9P's bad manners. How many such idioms can one subsume
into a "caching" process? Because in my opinion it makes more sense, as
I understand to have been Russ and Sape's proposal, to provide a
sliding-window version of the above that sends all of them at once:
if (stat(afile), open(afile), read(afile), close(afile)) {
...
} else {
perror ("");
}
Somehow, we may need to differentiate the error return and it sure looks
like programmers need to be aware of this implementation technique, but
is it preferable to construct a specialised cache that knows to generate
a get() whenever a stat() is performed? The latter doesn't really scale
to other potential scenarios and may add unwanted overheads.
++L