Re: cvs: php4 /ext/standard file.c
| From: | Stanislav Malyshev | Date: | Sat, 23 Dec 2000 14:02:22 +0000 |
| Subject: | Re: cvs: php4 /ext/standard file.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-3261@lists.php.net to get a copy of this message | ||
I'm reading this discussion and I fail to see what it is about. If we need
a function that will try as hard as pobbible to write N bytes to a
filehandle, what's bad with the following scheme:
int full_write(int s, char *buff, int length, int *bytes_written)
{
int full_length=length;
int writel;
*bytes_written = 0;
while(length > 0) {
writel = write(s, buff, length);
if(writel <= 0) {
if(errno == EINTR) continue;
return FAILURE;
}
buff += writel;
length -= writel;
*bytes_written += writel;
}
return SUCCESS;
}
Is there something I'm missing? Or did I misunderstand the point of the
discussion?
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115