Re: Addition to fileobject

Adrian Phillips (tandem@freeze.oslo.dnmi.no)
Wed, 16 Mar 1994 07:51:23 +0000

On Mar 16, 12:49am, Guido.van.Rossum@cwi.nl wrote:
> > if (f->f_close != NULL) {
> ^^^^^^^^^^^^^^^^^^^^^^^This test seems unnecessary.
> It makes your code stop working for file object variants without an
> explicit close function. (Bet you copied it from file_close :-).

Could be. I just hacked it in (slap wrist :-) )

> Otherwise it looks fine to me. (Could there be a problem that stdio
> does not want you to call setbuf when you've already done I/O?)

Yes, but this is the same for C programs.

>
> > Any chance of getting this into the OFFICIAL version (assuming it works
> > properly).
>
> I'd opt for an interface to setvbuf (without the silly magic
> constants). Something like these options is needed:
>
> - no buffering
> - line buffering
> - buffer of given size
>
> This could be done with a single integer parameter if we use a
> special value (e.g. -1) to mean line buffering.

Whatever you say. You're the BOSS :-).

Seriously, it sounds better as a parameter.

Adrian

-- 
---------------------
 ========================================================================
=   	    	    	    	    	    	    	    	    	 =
= Adrian Phillips at The Norwegian Meteorological Institute   	    	 =
=    	    	    	    	    	    	    	    	    	 =
= BUT any thoughts in this are purely my own and have nothing to do with =
= this establishment, thankfully.   	    	    	    	    	 =
=   	    	    	    	    	    	    	    	    	 =
= Internet: daap@typhoon.oslo.dnmi.no  	    	    	    	    	 =
= Phone: 47 22 96 32 09	    	    	    	    	    	    	 =
= Fax: 47 22 96 30 50	    	    	    	    	    	    	 =
=   	    	    	    	    	    	    	    	     	 =
 ========================================================================