> > You cannot do this, the usual idiom is that if read returns less
> > than the app expected this is treated as EOF.
> 
> Oh not, that's not at all true. Any program that behaves this way is
> broken. Unless I totally misunderstand your point.
> 

Ok,

You are probably right, its an assumption I have seen in code
in the past, though not in plan9:

        while((n = fread(buf, 1, sizeof(buf), fp)) != sizeof(buf))
                if(fwrite(buf, 1, n, out) != n)
                        sysfatal("write failed");

I have always tried to code defensively around it when writing
fileservers by returning full buffers, it seems I have been
fleeing a mere spectre.

-Steve

Reply via email to