I’d like to have some explications about read() on directory entries.
More precisely, if our resource manager declare a directory entry and
files in it, when a client open() and read() one of these files, we
receive two READ messages:
The first one is quite strange because it comes with an offset equal to
(file length) - 42 if the file length is greater than 42.
nleft = iofunc_attr_p->nbytes - ((iofunc_ocb_t *)ocb)->offset;
// allways equal to 42 ?!!?
And so, we have to reply with a piece of file following these values.
The second READ message is more understandable because this time, offset
is equal to 0.
nleft = iofunc_attr_p->nbytes - ((iofunc_ocb_t *)ocb)->offset;
In this case, nleft is equal to the file length.
First, I though about a problem with my resource manager but I verified
it with atoz.c from the Rob Krten’s book, replying a longer message
instead of just the capitalized entry.
What is the trick?
Why two messages?
Alain.