RE: [PHP-DEV] PHP 4.0 Bug #2483 Updated: set_file_buffer return value

From: Date: Sat, 10 Feb 2001 19:05:40 +0000
Subject: RE: [PHP-DEV] PHP 4.0 Bug #2483 Updated: set_file_buffer return value
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-46217@lists.php.net to get a copy of this message
cant === sort this one out in php4 James > -----Original Message----- > From: jimw@php.net [mailto:jimw@php.net] > Sent: 10 February 2001 18:49 > To: php-dev@lists.php.net > Subject: [PHP-DEV] PHP 4.0 Bug #2483 Updated: set_file_buffer return > value > > > ID: 2483 > Updated by: jimw > Reported By: leon@leonatkinson.com > Status: Open > Bug Type: Feature/Change Request > Assigned To: > Comments: > > refiling against 4.0. > > Previous Comments: > ------------------------------------------------------------------ > --------- > > [1999-10-10 17:51:29] leon@leonatkinson.com > I know this is nit-picky, but... Can someone change > set_file_buffer() so that its return values are more like other > PHP functions? Right now it returns false when you pass it bad > file handle, otherwise it returns whatever setvbuf returns. But > setvbuf() returns zero on success and non-negative if you pass it > bad type argument. The type is hard-coded, so it should always > return zero. Is there a problem with changing the return code from > > RETURN_LONG(ret); > > to > > if(ret){ > php3_error(E_WARNING,"illegal value for setvbuf type",id); > RETURN_FALSE; > } > else{ > RETURN_TRUE; > } > > which allows PHP code like > > <? > if(!set_file_buffer($fp)) > { > print("New buffer size not set!"); > } > > ?> > > Also, this sentence appears in my man page: > The setvbuf() function may be used after a stream is opened but > before it is read or written. > > It doesn't return any error when you try to do this, though, so > it must just ignore the request. How about adding a warning in > PHP about trying to set the buffer size after a read or write? > Or is it too much overhead to track this info? > > Thanks, > Leon > > ------------------------------------------------------------------ > --------- > > > > ATTENTION! Do NOT reply to this email! > To reply, use the web interface found at http://bugs.php.net/?id=2483&edit=2 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#46217) next »